Prolems of creating notepad application in C#?
-
1] Is there any method of load form2 from form1? 2] Is case of resize form1 ,when a form1 is loaded textbox size is equal to form1 size & when i hide the status bar this resize statement is work but at loaded time its not work what is reasion behind it? e.g. //above code is not work properly private void Form1_Load(object sender, EventArgs e) { //toolStripStatusLabel1.Text = "© 2006,Microsoft Corporation,All Rights Reserved"; textBox1.Font = new Font("Arial",16,FontStyle.Bold); textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 80)); } //above code is work properly private void statusBarToolStripMenuItem_Click(object sender, EventArgs e) { if (statusflag == false) { statusBarToolStripMenuItem.Checked = true; statusStrip1.Visible = true; statusflag = true; textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 80)); } else { statusBarToolStripMenuItem.Checked = false; statusStrip1.Visible = false; statusflag = false; textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 60)); } } desert_rose
-
1] Is there any method of load form2 from form1? 2] Is case of resize form1 ,when a form1 is loaded textbox size is equal to form1 size & when i hide the status bar this resize statement is work but at loaded time its not work what is reasion behind it? e.g. //above code is not work properly private void Form1_Load(object sender, EventArgs e) { //toolStripStatusLabel1.Text = "© 2006,Microsoft Corporation,All Rights Reserved"; textBox1.Font = new Font("Arial",16,FontStyle.Bold); textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 80)); } //above code is work properly private void statusBarToolStripMenuItem_Click(object sender, EventArgs e) { if (statusflag == false) { statusBarToolStripMenuItem.Checked = true; statusStrip1.Visible = true; statusflag = true; textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 80)); } else { statusBarToolStripMenuItem.Checked = false; statusStrip1.Visible = false; statusflag = false; textBox1.Size = new System.Drawing.Size((this.Width - 10), (this.Height - 60)); } } desert_rose
Stateless wrote:
1] Is there any method of load form2 from form1?
A form is just a class. You just instantiate the class and call the apropriate methods on it.
MyForm frm = new MyForm();
frm.Show();Stateless wrote:
Is case of resize form1 ,when a form1 is loaded textbox size is equal to form1 size & when i hide the status bar this resize statement is work but at loaded time its not work what is reasion behind it?
Why don't you just use the Dock[^] property on the text box to get it to fill the window by setting it to
DockStyle.Fill
. Then you don't have to worry about that because it will resize itself automatically.Stateless wrote:
//toolStripStatusLabel1.Text = "© 2006,Microsoft Corporation,All Rights Reserved";
I'm really curious about that line. Why were you thinking of assigning the copyright of your applicaiton to Microsoft?
Upcoming Scottish Developers events: * UK Security Evangelists On Tour (2nd November, Edinburgh) * Developer Day Scotland: are you interested in speaking or attending? My: Website | Blog