On Sat, 02 Jun 2007 15:18:10 -0700, Zeljko Bilandzija
<za*****@email.t-com.hrwrote:
I have Form1 (Main) and Form 2 (Options), and Form1 is main form, and I
want
on Form2 with button (btn800) change size of form1, and always is same
size.
Here is click event of my button and i don't know why it can't resize...
Which "frmMain" instance do you want to resize? Because, the code you
posted does in fact change the size of *some* instance of "frmMain", but
probably not the one you intend. You're creating a new instance of
"frmMain" every time you execute that method. Those instances are never
shown, but they do in fact get resized.
If you want to resize a previously-existing instance of "frmMain" (for
example, the one that gets created when you start your application), you
need to pass that reference to the options form so that it can access it..
Something like:
class frmOption
{
private frmMain _Main;
public frmOption(frmMain Main)
{
_Main = Main;
}
private void btn800_Click(object sender, EventArgs e)
{
_Main.Size = new Size(800, 600);
Close();
}
}
Pete