본문으로 바로가기

2020/8/18 WinForm

category 스마트팩토리/WinForm 2020. 8. 18. 18:33

보여지는 폼의 모습이다.

폼안에 코딩되어진 모습이다.

여러가지 이벤트를 넣었다. 너무 많이 넣은 관계로 모두 보여주지 못하는점 이해하기 바란다.

 

밑에 코드는 Form1.Designer.cs의 내용을 나타낸다.
여기에서 글자 위치, 색깔,크기등의 정보가 담겨져 있다.

 

namespace _2020_8_18WinForm
{
    partial class Form1
    {
        /// <summary>
        /// 필수 디자이너 변수입니다.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 사용 중인 모든 리소스를 정리합니다.
        /// </summary>
        /// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form 디자이너에서 생성한 코드

        /// <summary>
        /// 디자이너 지원에 필요한 메서드입니다. 
        /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
        /// </summary>
        private void InitializeComponent()
        {
            this.FactButton = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // FactButton
            // 
            this.FactButton.Location = new System.Drawing.Point(271, 54);
            this.FactButton.Name = "FactButton";
            this.FactButton.Size = new System.Drawing.Size(322, 170);
            this.FactButton.TabIndex = 0;
            this.FactButton.Text = "button1";
            this.FactButton.UseVisualStyleBackColor = true;
            this.FactButton.MouseLeave += new System.EventHandler(this.FactButton_MouseLeave);
            this.FactButton.MouseMove += new System.Windows.Forms.MouseEventHandler(this.FactButton_MouseMove);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Controls.Add(this.FactButton);
            this.Name = "Form1";
            this.Text = "코로나";
            this.DoubleClick += new System.EventHandler(this.Form1_DoubleClick);
            this.MouseLeave += new System.EventHandler(this.Form1_MouseLeave);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button FactButton;
    }
}

만약 니가 위에 Form1.cs의 코드를 지우게 되면 밑에와 같은 창이 뜨게 된다.

이 창의 오류 인스턴스에 들어가게 되면 밑에  창이 뜨게 된다.

빨간줄로 그어진 부분을 볼수 있다. 그부분을 지우게 되면 다시 오류 창이 없어지게 된다.

빨간줄로 그어진 부분은 원래는 Form1.cs의 코드 부분이 호출되면서 이부분으로 와서 저부분을 호출하게 되는데 

Form1.cs의 코드부분이 지워지게 되면서 빨간줄이 뜨고 오류가 뜨게 되는것이다.

 

위에 화면은 TextBox에 글자를 치면 밑에 화면이 나오게 된다.

코드는 밑에 있는 코드이다.

위에 TextBox에 내용을 넣고 버튼을 누르면 밑에 TextBox에 내용이 복사되서 들어가게 된다.

위에 코드를 입력하게 되면 그렇게 된다.

'스마트팩토리 > WinForm' 카테고리의 다른 글

2020/9/9 WinForm  (0) 2020.09.09
2020/8/21 WinForm  (0) 2020.08.21
2020/8/20 WinForm  (0) 2020.08.20