It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a Donation to help aid in operating costs.

I just read in one of Gizmo's mass emails that moderators are actually supposed to ENCOURAGE conversation in their forum, so huh, guess what, I guess I better get off my lazy mod *** and start thinking of something to say to a group of mostly non-programmers.

Wanna create cool looking windows but don't know how because VB tends to by default give you a plain jane window with a title bar and all windowy features? Well looky here, I'm going to talk about making fancy shmancy windows in VB.

first of all, we need to start with a clean slate. To get a plain square window with no features whatsoever, create a form and set the following properties:

BorderStyle = 0Caption = ""ControlBox = FalseShowInTaskbar = True(ShowInTaskbar is automatically set to false when you set the ControlBox to false - you should set it back to true)

There we go! Now it's borderless and has no title bar whatsoever. Now we need to make it cool looking. I'm going to change the background to black (BackColor = 0) and create a label to be my new title bar. I change the label's background and foreground colors and the font type/size and position it and size it where I want it. I'm also going to use the line control to draw a few lines on the edges of my form to create the effect of a border (for the borders, you may want to consider using the shape controls). Feel free to add any pictures or a background or whatever fits your style.

Now all that is pretty obvious stuff. Now for the REAL tip & trick. You want to have your user move the form around right? I chose to have it so that the custom title bar is draggable, but you can make it so that they can drag any part of the form. Here's the best way to do it:

Button = 1 will make sure the left button is pressed. ReleaseCapture will release the mouse's capture, and SendMessage will send a message to the window to let it know it needs to be dragged. If you want to be able to drag with either button, say "If Button > 0 Then". Also, I change my cursor to show a user that you can drag (lblHeader.MousePointer = 15)

ok, first of all you have to create the images. you need three images for each button: a normal state, hover state, and down state.

once youve create the images open up your project in vb. i always create one form that just holds all the images in one spot for organizations, say, call it frmImages. open that form up and create an Image. for our example well call it imgOK. set that Picture property to your buttons Normal state. now, copy and paste that Image, when it asks you if you wanna create a control array, say yes. the new image should be called imgOK(1). now set the picture to the Hover state. and copy, paste, and set imgOK(2) to the Down state.

aight, go back to your form where you want the button. create an image, well call it cmdOK. set the default picture to the Norm state. now add this code: