Reputation: 167
I'm working on a User control and I want to display it when in design mode a button has been selected and hide it when this one lost the focus.
This is the property and when a button has been set
public AnimatedButton MenuButton
{
get {
return _ButtonOwner;
}
set {
_ButtonOwner = value;
this.Visible = this.DesignMode; //===>Set visible the panel when is in a design mode
if (value != null) {
_ButtonOwner.StateChange += new AnimatedButton.StateChangeHandler (_OwnerStateChangeEvent);
}
}
}
what I want is when I select a button on design mode a other control set visible and when I lost the focus on the button the other control set invisible.
I already commited the changes to git hub if you some one want to take look to the code. I have a PanelWindow Control and AnimatedButton control, in Panel window control has the property menu button type of AnimatedButton and I can select a animiate button from the form , and what I want is when the menu button has selected the panel window set visible and when this lost focus the panel window hides, all this only in the design mode U.U I hope you guys can understand
Upvotes: 3
Views: 1313
Reputation: 22906
The design time environment does not take notice of your Visible property when deciding to show the control on the design surface. You can set the Visible property to whatever you like but it will still always show.
This is done so that you can still see and design a control that will be initially hidden when run.
Upvotes: 1