I possess a mother or father type with a strip menu known as
topMenu
.How can I enable/disable Main Menu Item on MDI Parent Form when I click on a. Just starting out with C# and i really need some help:) warm regards, ehyb. How to Enable or Disable BitLocker Auto-unlock for a Drive. The auto-unlock feature allows users to access data and removable data drives without having to enter a password each time. It is only valid when using BitLocker to encrypt OS drives.
I have a child form called 'SignIn' and when a consumer is usually logged in then I desire to disable the
topMenu.item.logIn
and enabletopMenu.item.Logout
.How Can I disable the
topMenu
of the parent box from the child type?When a user ticks of in the strip menu product 'Signal In' the following code will be executed.
after a consumer kind the username and the security password the following code can be executed
kennyzx10.5k55 gold badges2323 silver badges6666 bronze badges
JaylenJaylen13.8k3030 silver badges8585 silver precious metal badges159159 bronze badges
1 Solution
I'd significantly instead the parent Form obtain the data it requires from the kid Form, instead than the kid Form understanding too very much about the mother or father and modifying controls on it.
Add a property or home to your Login Form that results whether the consumer can be authenticated.(If
UserInfo
is definitely general public and can end up being referenced from outside the Login Form, then just make use of that and omit this phase.)Then go through that worth and get the suitable motion when the Login Form is shut.(This subscribes to the event that executes when the Login Form is shut, and shows it to run some program code.)
Right now there are much easier ways to do this, like simply instantiating a brand-new Login Form and making use of
GrantGrantShowDialog
instead of placing an MdiParent and docking and all that, but this should function with your existing code.55.9k88 magic badges8282 sterling silver badges130130 bronze badges