moxen
02-13-2002, 05:00 AM
I have been searching the web all morning looking for a way to change the design of the title and all I keep coming up with is changing the color, caption etc.
What I am wanting to do is make it look more like a windows XP style title bar using Win NT!!! or even change the border colour of the title bar without changin the colour of the form. Rounded corners would be good but I dont think that is possible in VB at the moment.
I think this is possible in other programming languages just I cant get it changed in VB.
What do ya think??
ChiefRedBull
02-13-2002, 05:22 AM
Hand made a wicked example of custom form shaping. Search the forum for "Hand AND houseform".
moxen
02-13-2002, 06:03 AM
Yes mate, it is very cool!!! Although it is changing the entire form. I only want to change the title bar.
The problem with VB is that it relys very closely on Windows API and because of this, custom designing of forms is quite limited.
I might work on creating a standard title for all forms and just do it with pretty pictures!!!
a simple way would be to set your form's .caption to "" and .controlbox to false, now just make your own title bar from an image/picbox/label or whatever and add your own buttons for min/max/close
Garrett Sever
02-13-2002, 06:20 AM
Originally posted by moxen
The problem with VB is that it relys very closely on Windows API and because of this, custom designing of forms is quite limited.
The API is what sets me free when it comes to designing forms ;)
Give me a better idea of what you want to do to the titlebar and I'll work something up. I wrote a component that paints a pattern across it about two years ago.
If you're serious, you only need to look into the GetDC() and ReleaseDC() functions (and maybe GetWindowDC() ). From there you can draw directly on the form's device context and do whatever you want. Just be aware that you'll have to redraw on _Resize and other events, and to get 100% coverage you'll have to subclass.
Later :D
moxen
02-13-2002, 07:02 AM
Okay, that was quite a bold statement to make :)
Have you ever worked in Windows XP? the basic frame of a form in XP is curved in the top left and right corners. I want to first of all achieve this kind of look with the smoothness of colour as well.But mainly, I have a lable at the top of my form and would like this to blend into the title bar to achieve a professional look.
I have put the form in question as an attachment to this post... The top banner is what I would like to blend into the title bar with curved edges on the title bar itself.
Let me know what you think...
reboot
02-13-2002, 07:43 AM
Obviously you've never looked at any of The Hand's work if you think that's a bold statement.....
Garrett Sever
02-13-2002, 07:46 AM
I'm having a hard time visualizing what you had in mind. You didn't include the .frx file, so none of the icons came thru.
Line 52: Class TabDlg.SSTab of control tabOperations was not a loaded control class.
Line 11: Property Icon in frmMainMenu had an invalid file reference.
Line 20: Property Picture in cmdOK had an invalid file reference.
Line 28: Property DownPicture in cmdExit had an invalid file reference.
Line 31: Property Picture in cmdExit had an invalid file reference.
Line 45: Property Picture in Picture1 had an invalid file reference.
thx reboot :D
moxen
02-13-2002, 08:10 AM
Sorry dude, my previous comment was aimed at me ;)
Your code for the houseform is fantastic!!!
What I am trying to achieve is to get a form with rounded corners and a graphical title bar. I think im gonna go with one of the pervious ideas and get rid of the control box and create some graphics and use these as the title bar. This has led me to another question though. How do I get a transparent background taken from a picture to work in VB?
Also, if you know an easy way of getting rounded corners on a form let me know.
I have included the frx for you now, maybe this will shed some light on what I want to do.
Cheers lads!
Garrett Sever
02-13-2002, 08:36 AM
Rounded corners will be easy. Getting the 3D effect on those rounded corners... well, that's a little harder.
The rounded corners can be achieved using similar code to what's in the house form. You will need to create and combine some regions, and then use the SetWindowRgn API function. You can find a short tutorial on regions here (http://www.elitevb.com/show.asp?id=1d1). To create the 3D effect, you will have to use GetSysColor() to get the right colors (I think they are button highlight and button dark or something) and maybe SetPixel (depending on how rounded it'll be) or Arc, or perhaps even RoundRect if you're doing all 4 corners.
I strongly suggest you pick up the AllApi.net (http://www.allapi.net) guide. They have some wonderful examples of these functions.
If you have any ?s or problems, lemme know :D