I have been having two problems that have been nagging with Windows Forms. One being the visibility modifier and updating a list box. To start off, I had trouble getting the menu strip highlight colors to change to what I wanted them to be. Fixed that by creating a new class that inherits from MenuStrip and then adding it to the main form. The program (more like game) is using several different panels to display different information and navigation controls. So instead of creating a bunch of different panels in the main form and setting the visibility to false until a button is pressed (putting a bunch of code in one place), I decided to make each panel a user control class (which automatically inherits UserControl). My problem with the visibility modifier is that I had to add each user control to the main form as public static in order for the other controls to set the visibility modifiers. Is there another way to implement something so I don't have to add all the user controls to the main form as public static?
The other problem I have is updating a listbox from one user control when I press a button on a different user control. Basically I have a user control which displays info from a list on a listbox with add, modify, delete buttons. When the user clicks add, they are taken to another user control to input the info they want. However, when they click save, I want to update the listbox with the added info. I tried to make the listbox static and have tried both class.listbox.DataSource = null then class.listbox.DataSource = list. That didn't work. Then I tried class.listbox.Refresh(). That didn't work as well.
I was thinking about maybe trying to use and Interface, but I am not exactly sure how they work or how to use them. To me, they seem like just a way of organizing like classes in order to save time typing a bunch of methods, but don't interact with each other.
Any help would greatly be appreciated.