Click to See Complete Forum and Search --> : How to change titlebar's color
susn
Feb 8th, 2001, 12:41 PM
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
Make your own custom title bar.
Take a look at this thread (http://www.vbforums.com/showthread.php?s=&threadid=52585) for an example.
Add to a Form with a PictureBox,
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.
Here's an API method.
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.