Results 1 to 7 of 7

Thread: Toolbar

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    Jersey
    Posts
    1
    Toolbar?....
    Well I want my programs to have their own toolbars...meaning, my own...

    Still dont know what Im getting at?
    Well the blue bar ontop of every program....i dont want that....i would like to make my own

    how would i go by doing that?

    _-=Motex=-_

  2. #2
    Guest
    Uhh. what do you mean? Toolbar or Titlebar or both?

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Set the form's caption to "" and the ControlBox property to False. Then, you can use your own titlebar.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Guest
    Code:
    Public Declare Function ReleaseCapture Lib "user32" () As Long
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
    Public Sub FormDrag(frm As Form)
    ReleaseCapture
    Call SendMessage(frm.hwnd, 161, 2, 0&)
    End Sub
    when you want to use put
    Code:
    Call FormDrag(Me)

    put it in the MouseDown Event of almost anything(label, cmd button, form, etc)

    that lets you drag a form without a title bar

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yep. Just before you posted I'd put that into my small example project. It now resizes properly, and handles the control buttons. It doesn't popup the system menu yet, but if anyone knows how, it'll be very welcome.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Here's a very rough example, which demonstrates right alignment of the title, since it's the same example I'm using for another thread:
    http://www.parksie.uklinux.net/newtitle.zip
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Guest
    A little different from the code Dennis gave, not using api:

    Code:
    'Label1 is your titlebar
    
    Dim oldX As Long, oldY As Long, isMoving As Boolean
    
    Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    oldX = X
    oldY = Y
    isMoving = True
    End Sub
    
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If isMoving Then
        Me.Top = Me.Top - (oldY - Y)
        Me.Left = Me.Left - (oldX - X)
    End If
    End Sub
    
    Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    isMoving = False
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width