AlexJames
Well-known member
- Joined
- Mar 20, 2020
- Messages
- 65
- Programming Experience
- 10+
Hi All
I'm building a C# winForms app, I have my main form with with some buttons as a menu. I have a docked panel which i show my forms in with the code below.
When the user clicks on the button to show the above form I change the back color of the button so that the user can visually see which menu item he clicked. The problem i'm having is when i close the form i want to reset the button color back to normal on my main form but i cant figure out how to do it. All my coding experience has been in Visual basic, so would simply do
How do i achieve this in C# ?
many thanks in advance
AJ
I'm building a C# winForms app, I have my main form with with some buttons as a menu. I have a docked panel which i show my forms in with the code below.
C#:
Form frm = new FrmSetupExchanges
{
TopLevel = false,
ControlBox = false,
Dock = DockStyle.Fill
};
PnlContainer.Controls.Add(frm);
When the user clicks on the button to show the above form I change the back color of the button so that the user can visually see which menu item he clicked. The problem i'm having is when i close the form i want to reset the button color back to normal on my main form but i cant figure out how to do it. All my coding experience has been in Visual basic, so would simply do
Visual Basic:
FrmMain.Cmdsetup.Backcolor = Color.Red
Me.Close
How do i achieve this in C# ?
many thanks in advance
AJ
Last edited by a moderator: