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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usercontrol Losing button on another user control

Status
Not open for further replies.

sburleson

Programmer
Oct 14, 2002
14
I am having a problem with a user control that I have created. The control consists of a textbox and a button and does have some logic to do things like hide the button if the whole control becomes disabled. When I place the control on a form, it works perfectly. However, when I place the control on another user control, the textbox works fine but it is like the button is missing. It is not displaying at all. I thought that since it uses an image, I maybe had to do something to propagate its image up to the parent user control, but if I click on the space it should be taking up, it is apparent that Windows does not think that it is there.

Again, placing the exact same control on a form is not an issue. Also, I have double and triple checked that my child user control is thought of as enabled by the parent user control. Does anyone have any ideas?

I have overrides of the following, so if someone thinks this might be an issue, let me know:

OnEnabledChanged <- so I can hide the button and so I can do this when disabled: Me.SetStyle(ControlStyles.UserPaint, True), I set it back to false when enabled and reshow the button.

OnPaint <- so I can control the display behavior when disabled

OnLayout <- so I can control exactly where the textbox and button are placed based on the size of the control.

 
I use Norton and it is up to date. I also tried disabling it and re-compliling my projects to no avail. Thanks for the idea, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top