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.
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.