Answer the question
In order to leave comments, you need to log in
How to painlessly redo the method of changing forms?
Hai!
I have already found a ton of options, but I wanted to ask how I can redo it in my case. I have a main form with a panel where I fill in the child forms. Via method:
private void OpenChildForm(Form childForm)
{
currentChildForm = clildForm;
clildForm.TopLevel = false;
clildForm.FormBorderStyle = FormBorderStyle.None;
clildForm.Dock = DockStyle.Fill;
panelDesktop.Controls.Add(clildForm);
panelDesktop.Tag = clildForm;
clildForm.BringToFront();
clildForm.Show()
}
OpenChildForm(new Form2());
Answer the question
In order to leave comments, you need to log in
I saved everything in ini for the necessary forms ... when I open it, I stupidly load it.
As I understand it, you want to use the same data in different forms without passing it.
You can use your project's Properties and access them from any form without passing anything.
In order to add them RMB to the project in Solution Explorer => Properties => Resources.
Thus, you will have stored resources that you can access from any part of the program and from any form.
From the code they are accessed by
ProjectName.Properties.PropertyName
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question