반응형
namespace buttonTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Int32 myVar=0;
private void button1_Click(object sender, EventArgs e)
{
// If myVar is an even number, click Button2.
if (myVar % 2 == 0)
{
MessageBox.Show("1번버튼 효과 없음");
button2.PerformClick();
// Display the status of Button2's Click event.
}
else
{
// Display the status of Button2's Click event.
MessageBox.Show("1번버튼 눌러짐 홀수");
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
myVar = Convert.ToInt32(textBox1.Text);
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show("2번 버튼 짝수 ");
}
}
'.NET > C# Form' 카테고리의 다른 글
C# 리치텍스트박스와 메뉴(MenuStrip) 컨텍스트메뉴(ContextMeneu) (0) | 2008.10.22 |
---|---|
C# 공통 대화상자 컨트롤(파일대화상자,텍스트박스,폰트/색상 대화상자,메세지박스) (0) | 2008.10.22 |
C# 예제로 배우는 컨트롤 (0) | 2008.10.21 |
C# 레이블 ( 레이블 링크) label (0) | 2008.10.21 |
C# 컨트롤 소스 컨트롤의 배열을 작성하려면 - 네이버 퍼옴 (0) | 2008.10.21 |
C# 핸들러 통합(라디오버튼) Tag (1) | 2008.10.21 |
C# 라디오 버튼 값 받기 (0) | 2008.10.21 |
C# 윈도우 폼 시작하기 (0) | 2008.10.17 |