2021년 목표설정

이미지
기본적으로 작년에 달성하지 못한 것들을 하려고 생각중인데..코로나가 언제까지 이어질지, 한국이나 북해도는 갈 수 있을지..자격증은 응시 가능할지..여러가지가 불확실하다. 2021년은 무엇보다 정신적인 부분과 경제적인 부분에 중점을 두고 조금 더 치열하게 지내보고 싶다. 일본나이로도 30대 마지막 해, 이제 불혹에 접어드는 나이..복잡하지만 심플하게. 육체적목표 : 트라이에슬론 스탠다드 도전하기 정신적 : 자격증2개 도전 + 자체개발 서비스 론칭 가족적 : 가정의 평화를 유지하기 경제적 : 외식과 유흥비를 줄이고 부수입을 늘려서 결과적으로 저축하기 사회적 : 목표세미나를 포함해서 민단과 개인인맥의 활성화와 교류를 촉진하기

C# 첫 번째 예제

사용Tool : Microsoft Visual Studio 2003
사용언어 : C#

Form Design 을 다음과 같인 한 후 출력하기 Button 을 DbClick 하면 소스창이 나타난다.
전체 Form 소스를 보면 다음과 같다.

// 프롤로그
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace lovelydai_ex1
{
 /// <summary>
 /// Summary description for Form1.
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
     private System.Windows.Forms.Label label1;
     private System.Windows.Forms.Label label2;
     private System.Windows.Forms.TextBox nameBox;
     private System.Windows.Forms.TextBox idBox;
     private System.Windows.Forms.Button submitBtn;
  /// <summary>
  /// Required designer variable.
  /// </summary>
     private System.ComponentModel.Container components = null;
  public Form1()
  {
      //
      // Required for Windows Form Designer support
      //
      InitializeComponent();
      //
      // TODO: Add any constructor code after InitializeComponent call
      //
  }
  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
      if( disposing )
      {
          if (components != null)
      {
          components.Dispose();
      }
   }
      base.Dispose( disposing );
  }
  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
      this.label1 = new System.Windows.Forms.Label();
      this.label2 = new System.Windows.Forms.Label();
      this.nameBox = new System.Windows.Forms.TextBox();
      this.idBox = new System.Windows.Forms.TextBox();
      this.submitBtn = new System.Windows.Forms.Button();
      this.SuspendLayout();
      //
      // label1
      //
      this.label1.Location = new System.Drawing.Point(16, 24);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(48, 32);
      this.label1.TabIndex = 0;
      this.label1.Text = "이름";
      //
      // label2
      //
      this.label2.Location = new System.Drawing.Point(16, 72);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(48, 32);
      this.label2.TabIndex = 1;
      this.label2.Text = "학번";
      //
      // nameBox
      //
      this.nameBox.Location = new System.Drawing.Point(64, 24);
      this.nameBox.Name = "nameBox";
      this.nameBox.Size = new System.Drawing.Size(136, 21);
      this.nameBox.TabIndex = 2;
      this.nameBox.Text = "";
    this.nameBox.TextChanged+=new System.EventHandler(this.nameBox_TextChanged);
      //
      // idBox
      //
      this.idBox.Location = new System.Drawing.Point(64, 72);
      this.idBox.Name = "idBox";
      this.idBox.Size = new System.Drawing.Size(136, 21);
      this.idBox.TabIndex = 3;
      this.idBox.Text = "";
      //
      // submitBtn
      //
   this.submitBtn.BackColor = System.Drawing.SystemColors.Desktop;
   this.submitBtn.Font = new System.Drawing.Font("DotumChe", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
   this.submitBtn.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
   this.submitBtn.Location = new System.Drawing.Point(48, 144);
   this.submitBtn.Name = "submitBtn";
   this.submitBtn.Size = new System.Drawing.Size(192, 48);
   this.submitBtn.TabIndex = 4;
   this.submitBtn.Text = "출력하기";
   this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click);
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(292, 273);
   this.Controls.Add(this.submitBtn);
   this.Controls.Add(this.idBox);
   this.Controls.Add(this.nameBox);
   this.Controls.Add(this.label2);
   this.Controls.Add(this.label1);
   this.Name = "Form1";
   this.Text = "Form1";
   this.ResumeLayout(false);
  }
  #endregion
  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }
  private void submitBtn_Click(object sender, System.EventArgs e)
  {
   MessageBox.Show("이름 : "+nameBox.Text+"\n"+"학번 : "+idBox.Text,"출력결과");
  }
  // 실제 출력을 담당하는 method..허벌나게 쉽다 쉬워 ㅋㅋ
  // lable의 Text 속성 접근은 [개체명].Text
  // 문자열은 다른 언어와 마찬가지로 "//..." 로 감싸준다
 }
}

댓글

이 블로그의 인기 게시물

성공적인 소셜커머스를 위한 10단계 전략

[C# & LINQ] 랜덤으로 데이터를 한 개 추출하는 방법

[메모] PostgreSQL에서 Insert 하는 경우 자동채번 PK가 중복에러 나는 경우