Creative2 Posted February 6, 2003 Posted February 6, 2003 Hi guys, Is there anyway to change the caption bar color? Thank you guys for all your help, you guys ROCK!! Quote
*Gurus* divil Posted February 6, 2003 *Gurus* Posted February 6, 2003 No. The closest you'll come is drawing it entirely by yourself. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
UCM Posted February 12, 2003 Posted February 12, 2003 What you could do... Divil's right, you can't change the colors or font of the caption bar directly, however, what you could do is bypass it altogeather and build your own... 1st: create a label ( or other control ) and design it as you wish as well as place it whereever you wish ( doesn't have to be accross the top of the form ) 2nd: rename it to: YourTitleBar 3rd: set both the form text to null and the captionbox to false in the form's properties... Additionally, set the form's FormBorderStyle to (None)---NOTE: this will Only work if the control (with the mouse e. event code in it) is on the form itself and NOT on a panel or tabcontrol, ect... 4th: put the following code in your form: Dim Mouse_Offset As Point Private Sub YourTitleBar_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourTitleBar.MouseDown Mouse_Offset = New Point(-e.X - YourTitleBar.Left, -e.Y - YourTitleBar.Top) End Sub Private Sub YourTitleBar_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles YourTitleBar.MouseMove If e.Button = MouseButtons.Left Then Dim mousePos As Point = Control.MousePosition mousePos.Offset(Mouse_Offset.X, Mouse_Offset.Y) Location = mousePos End If End Sub NOTE: you can create your own buttons, labels, or anything else to maximize, minimize, and normalize the form as well as end the program by putting in the button's ( or whatever control you assign for this purpose ) _Click( blah blah ) event like: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.WindowState = FormWindowState.Minimized End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.WindowState = FormWindowState.Normal End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.WindowState = FormWindowState.Maximized End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End End Sub Quote UCM >-)
*Experts* Volte Posted February 12, 2003 *Experts* Posted February 12, 2003 Just don't use End! Me.Close() will do just fine. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.