버튼 하나 만들고 클릭시 메시지 창 띄우는 초간단 예제 입니다.
public class ExampleForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button myButton;
{
private System.Windows.Forms.Button myButton;
public ExampleForm()
{
Text = "An Example Form";
myButton = new System.Windows.Forms.Button();
myButton.Location = new System.Drawing.Point(50, 50);
myButton.Size = new System.Drawing.Size(175, 50);
myButton.Text = "Click Here";
myButton.Click += new System.EventHandler(myButton_Click);
Controls.Add(myButton);
}
{
Text = "An Example Form";
myButton = new System.Windows.Forms.Button();
myButton.Location = new System.Drawing.Point(50, 50);
myButton.Size = new System.Drawing.Size(175, 50);
myButton.Text = "Click Here";
myButton.Click += new System.EventHandler(myButton_Click);
Controls.Add(myButton);
}
private void myButton_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.MessageBox.Show("Button Clicked");
}
}
{
System.Windows.Forms.MessageBox.Show("Button Clicked");
}
}
class Displayform
{
static void Main()
{
System.Windows.Forms.Application.Run(new ExampleForm());
}
}
{
static void Main()
{
System.Windows.Forms.Application.Run(new ExampleForm());
}
}
오라클자바커뮤니티 실무 개발자 과정 - 개인80% 환급
댓글 없음:
댓글 쓰기