Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 23rd, 2008, 12:03 AM   #1
kurt
Programmer
 
Join Date: Oct 2005
Posts: 68
Rep Power: 3 kurt is on a distinguished road
Changing just button apperance

I've been looking at how to change the appearance of a Button.

I've managed to changed it to have rounded edges but over-riding OnPaint, however I lose the default capabilities like "enabled" and setting text up easily from the Properties menu.

If I overide OnPaint for rounded-edge appearance, I need to perform all other things as well (drawString, etc).

If i call base.OnPaint( ) first, my drawings will cover it anyway.

So the question is, any simple way to just change the apperance, but retain all other functionality?

Thanks in advance.
kurt is offline   Reply With Quote
Old Apr 23rd, 2008, 2:27 AM   #2
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,033
Rep Power: 5 lectricpharaoh will become famous soon enough
Re: Changing just button apperance

Quote:
Originally Posted by kurt
So the question is, any simple way to just change the apperance, but retain all other functionality?
To my knowledge, the answer is 'no'. If you want an owner-drawn control, then as the owner, you're going to need to draw it.

However, you really only need to draw the button itself (taking into account whether it's normal or 'greyed out' for disabled; you can accomplish the latter by simply adjusting the colors in your OnPaint() method), and then the text on it. Drawing the text is easy, but figuring out placement of the text and its bounds, etc, is harder (though not that hard).
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista Elements Button Alias Existing Project Development 2 Nov 9th, 2007 5:25 PM
Applet / Button problem. TCStyle Java 1 Apr 29th, 2007 11:10 AM
Disabling "Ok" button jayme C++ 2 Jan 9th, 2006 4:50 AM
IE and dynamic button creation MegaArcon JavaScript and Client-Side Browser Scripting 5 Dec 6th, 2005 8:31 AM
Browse button??? ktsirig HTML / XHTML / CSS 7 Oct 8th, 2005 6:21 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC