Results 1 to 4 of 4

Thread: How to change titlebar's color

  1. #1

    Thread Starter
    Member susn's Avatar
    Join Date
    Feb 2001
    Location
    Dubai
    Posts
    48

    Question

    Hi there,

    i'd like to change the color of the titlebar of my application.
    Can someone tell me if there is some API function to do this?
    (i want to change the titlebar only of mine application. so changing the system settings isn't a good idea)

    Susn

  2. #2
    Guest
    Make your own custom title bar.
    Take a look at this thread for an example.

  3. #3
    Guest
    Add to a Form with a PictureBox,
    Code:
    Private OldX As Single
    Private OldY As Single
    
    Private Sub Form_Load()
        Picture1.Align = 1
    End Sub
    
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            OldX = X
            OldY = Y
        End If
    End Sub
    
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = vbLeftButton Then Move Left + (X - OldX), Top + (Y - OldY)
    End Sub
    you can use this Picturebox as a titlebar and use the PictureBox as your titlebar.

  4. #4
    Guest
    Here's an API method.
    Code:
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Private Const WM_NCLBUTTONDOWN = &HA1
    Private Const HTCAPTION = 2
    
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        ReleaseCapture
        SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0
    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