B
Boki
Hi All,
I want to change WindowState of form1 from form2.
I tried these two methods, but no luck on both.
(1) Declare a public method:
/* function of form1 */
public void active_this_form()
{
this.WindowState = FormWindowState.Normal;
this.Focus();
this.Show();
}
After call this function from form2, form1 keeps minimized.
(2) Use reference:
/* Code in form1 */
public partial class Form1 : Form
{
public static Form1 staticVar = null;
....
/* Code in form2 */
Form1.staticVar.WindowState = FormWindowState.Normal;
This code can't compile.
The second method can modify a variable, but seems can't modify the
properties of form ?
Thanks!
Best regards,
Boki.
I want to change WindowState of form1 from form2.
I tried these two methods, but no luck on both.
(1) Declare a public method:
/* function of form1 */
public void active_this_form()
{
this.WindowState = FormWindowState.Normal;
this.Focus();
this.Show();
}
After call this function from form2, form1 keeps minimized.
(2) Use reference:
/* Code in form1 */
public partial class Form1 : Form
{
public static Form1 staticVar = null;
....
/* Code in form2 */
Form1.staticVar.WindowState = FormWindowState.Normal;
This code can't compile.
The second method can modify a variable, but seems can't modify the
properties of form ?
Thanks!
Best regards,
Boki.