코더아니야개발자야

  • 홈
  • 태그
  • 방명록

MessageBox 2

019_BasicControl

TextBox를 이용해 사용자로부터 문자열을 입력받자. 폼에서 TextBox/ Label1,2 /Button을 끌어와 사진처럼 배치하자 Label2는 TextBox밑에 위치하여 Label의 내용은 공백으로 둔다. private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") MessageBox.Show("이름을 입력하세요.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); else label1.Text = textBox1.Text + "님! 안녕하세요"; } Button1의 Click event 이다. if-else문을 이용해 Text가 있는지 없는지를 활용..

C# 2022.03.30

018_MessageBox

이와 같은 메시지 박스를 출력해보자 private void Form1_Load(object sender, EventArgs e) { MessageBox.Show("가장 간단한 메시지 박스 입니다."); MessageBox.Show("타이틀이 있는 메시지 박스 입니다.", "title"); DialogResult result1 = MessageBox.Show("두개의 버튼이 있는 메시지 박스입니다.", "Question", MessageBoxButtons.YesNo); //두개의 버튼에서 나온 값을 result1에 저장 DialogResult result2 = MessageBox.Show( "세개의 버튼이 있는 메시지 박스입니다.", "Question", MessageBoxButtons.YesNoCance..

C# 2022.03.30
1
더보기
프로필사진

What time is it now?
00/00/00
00:00

컴퓨터랑 일하는 건 엄청 멋있다.

누구랑 싸우지도 않고, 모든 것을 대신 기억해주고,

내 맥주를 뺏어 마시지도 않는다. - Paul Leary

  • 분류 전체보기 (76)
    • 대학원 (0)
      • Paper Review (0)
    • C# (51)
    • 리눅스 (11)
    • App Inventor (12)
    • BAEKJOON,백준 (2)

Archives

Calendar

«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바