0% found this document useful (0 votes)
3 views1 page

Windows Forms Button Click Examples

This C# code defines a Windows Forms application with two buttons. When button1 is clicked, it opens a new Form2 as a modal dialog window, blocking interaction with the original form until it closes. When button2 is clicked, it opens a new Form3 in a modeless way, allowing interaction with both forms simultaneously.

Uploaded by

balaji vaithi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Windows Forms Button Click Examples

This C# code defines a Windows Forms application with two buttons. When button1 is clicked, it opens a new Form2 as a modal dialog window, blocking interaction with the original form until it closes. When button2 is clicked, it opens a new Form3 in a modeless way, allowing interaction with both forms simultaneously.

Uploaded by

balaji vaithi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

using System;

using [Link];
using [Link];
using [Link];

namespace WindowsFormsdepan
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
Form2 f = new Form2();//MODAL
[Link]();
}

private void button2_Click(object sender, EventArgs e)


{
Form3 f3 = new Form3();//MODALESS
[Link]();
}
}
}

You might also like