Tell panelSetting how to clear the panelSetting in the form FormSetting when you click on the button in FormMain
It seems to have installed Public everywhere but it does not come out, an error about the need to reference an object.
You must have a code somewhere that runs the FormSettings form. It should be something like this:
FormSettings formSettings; private void button1_Click_1(object sender, EventArgs e) { formSettings = new FormSettings(); formSettings.Show(); } To clean the panelSetting you can write:
private void button2_Click(object sender, EventArgs e) { if (formSettings != null) formSettings.panelSettings.Controls.Clear(); } FormSettings formSettings; line FormSettings formSettings; where to find her? - VitokhvFormSetting form on which there is a panelSetting that you want to clear. - kosheSource: https://ru.stackoverflow.com/questions/692774/
All Articles
FormSetting formSetting ...in the codeFormSetting formSetting ...UseformSetting.panelSetting.Controls.Clear();- IgorFormSettingwould be black, and so it indicates that the name of the form with a capital letter exists. - VitokhvFormSettingis a type. You need an object reference. - Igor