Hello,
I try from one form by clicking the button to open another form. I put this code, but nothing happens:
private void button1_Click(object sender, EventArgs e)
{
Izvest frm = new Izvest();
frm.Show();
}
Can anybody tell me please where is my error.
The second form's name is Izvest.
Thanks.
Loading
VulpesPosted Aug 11, 2011, 5:32 AM
Sam HobbsPosted Aug 12, 2011, 7:31 PM
NelPosted Aug 12, 2011, 2:12 PM
Sam HobbsPosted Aug 12, 2011, 1:11 PM
NelPosted Aug 12, 2011, 2:26 AM
Sam HobbsPosted Aug 11, 2011, 2:42 AM
Try this. First put a MessageBox at the end (after the frm.Show()) of the button1_Click method. Then put a breakpoint on the first line (Izvest frm = new Izvest()) of the button1_Click method and then debug with that. Assuming that the breakpoint is hit, press F5 when it is hit. After that, you should see the MessageBox. Let us know what happens from that.
NelPosted Aug 11, 2011, 2:10 AM
NelPosted Aug 11, 2011, 2:06 AM
At Izvest.cs, line 17 character 13 ('Bl_jt.Izvest.Izvest()',line 3)
The brakepoint will not currently be hit. No symbols have been loaded for this document.
Sam HobbsPosted Aug 10, 2011, 7:30 PM
Do you know how to use the debugger? You should put a breakpoint in the constructor for Izvest, then debug the program. Do you know what I mean by "constructor"? You can put a breakpoint in the constructor (such as the line that calls InitializeComponent()) by going to (putting the cursor in) that line and pressing F9. A red ball will appear in the left margin. Then press F5. If, when you click the button the debugger stops at the breakpoint then that gives us a big clue. If it does, then just press F5 a second time, close the program and post a reply here telling us that it did that. If the debugger does not stop at the breakpoint then post a reply here telling us that it did not.
VulpesPosted Aug 10, 2011, 8:58 AM
Izvest frm = new Izvest();
frm.ShowDialog(this);
NelPosted Aug 10, 2011, 7:25 AM
public partial class Izvest : Form
{
public Izvest()
{
InitializeComponent();
}
}
Om prakash SinghPosted Aug 10, 2011, 7:06 AM
If you can please send me the code of second page.
NelPosted Aug 10, 2011, 7:00 AM
Priya: I saw the code, but the code I need is the same like mine.
I still have the problem
Priya LingePosted Aug 10, 2011, 6:31 AM
I did samething ,Second form open by button click.
private void button1_Click(object sender, EventArgs e)
{
Form2 fr = new Form2();
fr.Show();
}
Please see attached file.
Hope this will help you.
Thanks.
Om prakash SinghPosted Aug 10, 2011, 6:25 AM
Private void button1_Click(object sender, EventArgs e)
{
Izvest frm = new Izvest();
frm.Activate();
frm.BringToFront();
frm.Show();
}