Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabled controls not turning grey

Status
Not open for further replies.

Bluejay07

Programmer
Mar 9, 2007
780
CA
Hello,

I am relatively new to VB.net. Most of my work is in VB6 and I am trying to duplicate some VB6 functionality but cannot.

I have a form containing several buttons. Each button contains a background image. These buttons are being used as navigation buttons for a dataset (first button, previous button, next button, last button and a finder).

Whether in code or at runtime, if I set the buttons to enabled = false, the user cannot click the buttons, however, the buttons do not seem to be greyed out.

How can I set the buttons to disabled and have them greyed out so the user doesn't think he can click it?

Thanks.
 
Further Information:

The background image is a 32 x 32 icon file. I have copied the control and changed from the background image to an image. Doing this allows the control to greyout.

If I continue with the image, the image does not fit properly in the size of the button I have defined. I have tried to reduce the size of the icon to 16 x 16, and the size fits, although the image appears really pixelated.
 
Bluejay07,
You could build custom "disabled" images and replace the enabled images with the disabled ones when you run your routine to disable your buttons. That would get around this annoying issue and add flair to your application since you would get to use the image resolutions of your choice.

Charles
Quality Assurance/Developer
 
Thanks for your reply.

I did play around with VB settings and my icon. I was able to get it working as needed. Basically I had to change it from a background image to an image.

As for your suggestion, that could be a possibility, however, not for me. The icons can be very details and even modifying the icon can be difficult.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top