[3.0] Invisible or disabled control cannot be activated
I'm deriving a class from Form.
In my project i've designed 2 subclasses of this class (using the form designer as you would subclass the Form class).
In one form i'm trying to show the other one modelly, but i get the following error message: "Invisible or disabled control cannot be activated" when trying to either set the active control of the calling form to be the new form, or trying to set a control on my model form to be active.
Hope that made sense, any help would be much appreciated.
Re: [3.0] Invisible or disabled control cannot be activated
Are those controls you try to activate disabled or hidden at the time?
Re: [3.0] Invisible or disabled control cannot be activated
That's what i'm having trouble with. I'm not sure how a form (or any control) determines whether it's active or not. I've tried calling things like Activate() on the Form before trying to set it as the active control but nothing seems to make a difference.
I think the problem is that it determines whether it's active/disabled or not using windows APIs using it's internal handle, rather than a simple boolean private member. The problem is that at no point do i show any form (even the one that's doing the Show(ModelForm) call) since i'm using a graphics library (XNA) to render all controls.
This is definatly the root of the problem, but i'm not sure how to get round it.
Re: [3.0] Invisible or disabled control cannot be activated
That's obviously the problem... You have no form shown, thus none of the controls is visible.
Re: [3.0] Invisible or disabled control cannot be activated
So what i'm asking is, how do i get round that, or don't i?