|
-
Jun 16th, 2005, 12:46 AM
#1
Thread Starter
Fanatic Member
Change the way controls look
Hey,
How (if it's even possible) could I change the appearance of a control.
Say a command button for instance, if I want to change how it appears so instead of the default grey button I could have a flat blue button with a black outline and white text, stuff like that?
Is this even possible in any simple way with VB.. or I'd even be willing to know the hard way lol 
Thanks,
Steven
-
Jun 16th, 2005, 12:57 AM
#2
Re: Change the way controls look
You can change the backcolor of a CommandButton if you set the Style property to Graphical. You can also subclass and watch for messages like WM_PAINT to change the appearence, but for a custom styled button it would probably be easier to just create your own usercontrol.
-
Jun 16th, 2005, 01:00 AM
#3
Re: Change the way controls look
sure!
Take a checkbox, make its style property to graphical.
Back color blue, forecolor white : )
-
Jun 16th, 2005, 01:54 AM
#4
Re: Change the way controls look
Two customizable User Controls by me:
UniCommand
UniLabel
Allows you to use Unicode as well. You have to code a replacement code for DrawEdge though, if you want to change that what to you want (I think, haven't taken a look in the source in a while).
-
Jun 16th, 2005, 05:47 AM
#5
Re: Change the way controls look
Anything with a click event can be used as a command button. You could use Image controls, or picture boxes with your own embedded images (providing you don't want to go the route of the UserControl.)
-
Jun 16th, 2005, 02:40 PM
#6
Thread Starter
Fanatic Member
Re: Change the way controls look
Well those solutions solve the problems of command buttons. But I mean't all controls, like another example that wouldn't be as simple, what if I wanted a textbox to look different. Instead of having a white background I wanted a black background with white text and didn't want the 3d edges on it. Just using a picture box there wouldn't really be acceptable. I'll look into intercepting the WM_PAINT, that might be a workable solution if I can figure it out.
-
Jun 16th, 2005, 03:12 PM
#7
Re: Change the way controls look
Just take the borders completely out of the textbox and use, well, DrawEdge to draw borders you like or just basic Line command. Or FillRect if you want to use API. It isn't even too hard to make it a user control, though that is a bit too much for so small changes.
-
Jun 16th, 2005, 03:20 PM
#8
Thread Starter
Fanatic Member
Re: Change the way controls look
Yeah it's not huge changes. A friend of mine needs a database frontend program, easy enough, the catch is she wants the entire thing to look and feel like a normal webpage hehe. I suppose if I really wanted to I could just write the entire thing as a local ASP webpage, but once I figure out how to change all the appearences and all it should be easy enough in VB.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|