G
Guest
Please, help.
I created my contol, ButtonX, which subclasses System.Forms.Windows.Button
class. I am doing my own paiting, by overriding OnPaint and
OnPaintBackground (without calling base class's OnPaint &
OnPaintBackground). My button has a shape of rectangle with rounded corners
and is filled with gradient brush, where user specifies the gradient colors.
The dilema I have now is how to paint the button when it's disabled (Enabled
= false). I know how to detect when this happens, but I am not sure how to
give my button the "disabled" look, so it would be somewhat similar to how
native windows controls look.
The idea I had was to BitBlt my button to an image, convert the image to a
gray scale image, and maybe to increase the brightness of RGB in gray scale
(to make it look different if the button is already gray). But it seems like
a hack to me.
Is there a built-in .NET functionality to do something like this? Or maybe a
better way than the one I described above?
There are a lot of other custom controls that I will have to build, so I
guess I am looking for a more or less generic solution.
Thanks for all the help and suggestions.
VR
I created my contol, ButtonX, which subclasses System.Forms.Windows.Button
class. I am doing my own paiting, by overriding OnPaint and
OnPaintBackground (without calling base class's OnPaint &
OnPaintBackground). My button has a shape of rectangle with rounded corners
and is filled with gradient brush, where user specifies the gradient colors.
The dilema I have now is how to paint the button when it's disabled (Enabled
= false). I know how to detect when this happens, but I am not sure how to
give my button the "disabled" look, so it would be somewhat similar to how
native windows controls look.
The idea I had was to BitBlt my button to an image, convert the image to a
gray scale image, and maybe to increase the brightness of RGB in gray scale
(to make it look different if the button is already gray). But it seems like
a hack to me.
Is there a built-in .NET functionality to do something like this? Or maybe a
better way than the one I described above?
There are a lot of other custom controls that I will have to build, so I
guess I am looking for a more or less generic solution.
Thanks for all the help and suggestions.
VR