Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Say for instance I have a C# Winforms applciations that uses a tabcontrol with four different tab pages. Above this control on the main form are a series of groupboxes containing various buttons and textboxes relevant to the different functions running on each individual tabpage.

If I am using a particular tabpage that only makes use of some of the controls, I want to disable the others so that the user cannot accidentally click the wrong buttons.

Example Logic:

If(tabpage1.selected)   
{
   button3.Disabled();
}

Does anyone know of a way of implementing this kind of functionality?!

Regards,

EDIT:

Essentially I want to be able to disable groupboxes!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
159 views
Welcome To Ask or Share your Answers For Others

1 Answer

Rather than calling .Disabled(), set the .Enabled property to false. To make this easier, you can put the related controls into the same container (Panel control), and just set Enabled to false for that container.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...