❔ Windows Form help
I have the source code for an application that utilizes Windows Forms, but I have no experience working with forms. Could you please guide me on how to switch between tabs in the application? Specifically, I would like to access the "packing" and "options" screens. I have attached a screenshot for reference.
Thank you in advance for your assistance.
12 Replies
Depends on how it was programmed. Are the other pages being created in code?
Easiest way to figure it out is to see where the click event for that button leads to. Check its property values in the designer
That is.. assuming the click event is registered through the designer
Yeah i click the button and it sends me to the code
We've got FormMain.cs, FormMain.Designer.cs & FormMain.resx
I'd be happy to DM them to you if you like?
Actually, there's nothing super important in them, ill attach them here
I can't seem to access this tab
Or this
In desginer
it seems the code file is doing a lot of work in creating controls outside InitializeComponent, that you can't see in the designer
The Designer view is bound to the auto-generated Designer.cs file and its InitializeComponent method.
That's unfortunate, is there anyway to easily add/remove buttons and so on or would it be easier to rewrite the UI?
You could paste the code to a new form's Designer and add the form as a control when the button is clicked
That will be a very breaking change however. The controls on the page will be members within the page control and are private by default. You can change the accessibility in the Properties
Also since the pages are only used within a form, you could create them as UserControls instead of Form. It's just more lightweight
The positioning of everything is also likely to be off after the change.
After checking the code again, it seems each page is contained in a GroupBox control that is made visible when the button is clicked
So everything exists at runtime, you just have to change the visibility of the groups in the designer to see the other ones.
Tbh the whole thing is a mes
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.