2021년 목표설정

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

C# 예제 두번째



사용 Tool : MiscroSoft Visual Studio 2003
사용 언어 : C#
개       요 : 무지 간단한 곱셈 계산기..설명이 필요하냐??
                결과 부분은 속성의 ReadOnly Property 를 True 로 변환하면 읽기전용이 된다.

[ Source ]
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace lovelydai_ex2
{
 /// <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 numBox_1;
  private System.Windows.Forms.TextBox numBox_2;
  private System.Windows.Forms.TextBox answer;
  private System.Windows.Forms.Button Submit;
  /// <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.numBox_1 = new System.Windows.Forms.TextBox();
   this.label1 = new System.Windows.Forms.Label();
   this.numBox_2 = new System.Windows.Forms.TextBox();
   this.label2 = new System.Windows.Forms.Label();
   this.answer = new System.Windows.Forms.TextBox();
   this.Submit = new System.Windows.Forms.Button();
   this.SuspendLayout();
   //
   // numBox_1
   //
   this.numBox_1.AutoSize = false;
   this.numBox_1.Location = new System.Drawing.Point(16, 24);
   this.numBox_1.Name = "numBox_1";
   this.numBox_1.Size = new System.Drawing.Size(88, 32);
   this.numBox_1.TabIndex = 0;
   this.numBox_1.Text = "";
   //
   // label1
   //
   this.label1.Font = new System.Drawing.Font("DotumChe", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
   this.label1.Location = new System.Drawing.Point(112, 32);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(56, 32);
   this.label1.TabIndex = 1;
   this.label1.Text = "곱하기";
   //
   // numBox_2
   //
   this.numBox_2.AutoSize = false;
   this.numBox_2.Location = new System.Drawing.Point(176, 24);
   this.numBox_2.Name = "numBox_2";
   this.numBox_2.Size = new System.Drawing.Size(88, 32);
   this.numBox_2.TabIndex = 2;
   this.numBox_2.Text = "";
   //
   // label2
   //
   this.label2.Font = new System.Drawing.Font("DotumChe", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
   this.label2.Location = new System.Drawing.Point(272, 32);
   this.label2.Name = "label2";
   this.label2.Size = new System.Drawing.Size(56, 32);
   this.label2.TabIndex = 3;
   this.label2.Text = "는?";
   //
   // answer
   //
   this.answer.AutoSize = false;
   this.answer.Location = new System.Drawing.Point(328, 24);
   this.answer.Name = "answer";
   this.answer.ReadOnly = true;
   this.answer.Size = new System.Drawing.Size(88, 32);
   this.answer.TabIndex = 4;
   this.answer.Text = "";
   //
   // Submit
   //
   this.Submit.Location = new System.Drawing.Point(40, 88);
   this.Submit.Name = "Submit";
   this.Submit.Size = new System.Drawing.Size(352, 32);
   this.Submit.TabIndex = 5;
   this.Submit.Text = "결 과 보 기";
   this.Submit.Click += new System.EventHandler(this.button1_Click);
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(440, 157);
   this.Controls.Add(this.Submit);
   this.Controls.Add(this.answer);
   this.Controls.Add(this.label2);
   this.Controls.Add(this.numBox_2);
   this.Controls.Add(this.label1);
   this.Controls.Add(this.numBox_1);
   this.Name = "Form1";
   this.Text = "Form1";
   this.Load += new System.EventHandler(this.Form1_Load);
   this.ResumeLayout(false);
  }
  #endregion
  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }
  private void button1_Click(object sender, System.EventArgs e)
  {
   answer.Text = Convert.ToString(Convert.ToInt16(numBox_1.Text) * Convert.ToInt16(numBox_2.Text));
  }
  // Convert Object 에 여러가지 변환 Method 가 존재하는데..
  // ToString 은 문자열로 변환, ToInt16 은 16bit 정수형으로 변환하여 준다.
  // 입력한 숫자는 문자열 이므로 각각 ToInt16 method 로 숫자형으로 변환하여 준 후..
  // 결과값을 Textbox 에 찍기 위해서는 기본적으로 문자열을 사용해야 하므로..
  // 문자열로 변환하여 준다. 
 }
}

댓글

이 블로그의 인기 게시물

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

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

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