PDA

View Full Version : Visual Basic Visual Styles Help



gimillii1592
11-24-2008, 03:17 PM
Hello, I am relatively new to Visual Basic, and I was wondering how you changed the visual style of a Visual Basic program (like the theme).
Here is a picture:

http://i240.photobucket.com/albums/ff154/gimillii159/SPAMMER.gif

How do I change the blue area on the top and the buttons on the window to a different theme?
Thank you.

Laimonas171
12-17-2008, 09:11 PM
include source please. i watch what i can do 4u :)

Bad Processor
01-31-2009, 04:23 PM
EDIT: BUMPED! I just realised, oops.
Hmm, okay, I think I can help here.

1. Change your BorderStyle to 0 - None.
2. Copy and paste this into the top of your form code. (Put any API calls in-between option explicit and the subs)


Option Explicit
Dim XPos As Long, YPos As Long

Private Sub TopBar_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
XPos = X
YPos = Y
End Sub

Private Sub TopBar_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Me.Left = Me.Left - (XPos - X)
Me.Top = Me.Top - (YPos - Y)
End If
End Sub3. Create any object that you want the user to drag to move the form. Name this TopBar.
4. Create buttons or whatever, whereever you want for the X (close) and _ (minimize) buttons. Maximizing your form makes it look odd, so I'll leave that out.
5. On the Close button code, type in

Unload Me6. On the minimize button code, type in

Me.WindowState = vbMinimized7. Make sure the boolean ShowInTaskbar is set to true.

There you go, a fully working, custom, border!

Note: If you want professional X and _ icons on your close and minimize buttons, follow this:
1. Change the button font to Marlett, not bold, any size.
2. If the button is a close button, type in r. If it is minimize, type in 0 (zero). Make sure the r is not capital.

Or of course, you could try the vbSkinner control that costs money. The free version only has one skin :(

So, that's all my help. This is for VB6 btw, not VB.NET

http://i43.tinypic.com/16ibg1.gif

-- BP

pinoyid0l
02-01-2009, 04:42 AM
If you really want to make it anything you like, just remove the the border. Use pictures (just like what websites do) in place of system buttons and borders.




-my eyes hurt with VB6 interfaces...