96. 마스크(Mask) / 리치(Rich) / 읽기전용(ReadOnly) 텍스트박스(TextBox)
.NET프로그래밍/WinForm 2009. 8. 24. 09:48 |
==> Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace MyWinForms
{
static class Program
{
/// <summary>
/// 해당 응용 프로그램의 주 진입점입니다.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
==============================================================================================
==> MainForm.cs
private void miTextBox_Click(object sender, EventArgs e)
{
MyWinForms.Controls.FrmTextBox ftb = new MyWinForms.Controls.FrmTextBox();
ftb.MdiParent = this;
ftb.Show();
}
==============================================================================================
==> FrmTextBox.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyWinForms.Controls
{
public partial class FrmTextBox : Form
{
public FrmTextBox()
{
InitializeComponent();
}
private void btnOK_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("싱글라인 : " + txtSingleLine.Text);
sb.AppendFormat("멀티라인 : {0}", txtMultiLine.Text);
sb.Append(String.Format("패스워드 : {0}", txtPassword.Text));
sb.Append("마스크 : " + txtMaskedText.Text);
sb.AppendFormat("리치 : {0}", txtRichTextBox.Text);
MessageBox.Show(sb.ToString());
}
}
}
< 실행결과 >
/*
읽기전용(ReadOnly) 텍스트박스는 텍스트박스와는 달리 텍스트박스에 이미 텍스트가 입력되어 있으며, 레이블에 쓰여져 있는 텍스트와는 달리 긁어서 복사할 수 있다.
*/
'.NET프로그래밍 > WinForm' 카테고리의 다른 글
98. 메시지박스(MessageBox) (0) | 2009.08.24 |
---|---|
97. 링크레이블(LinkLabel) (0) | 2009.08.24 |
95. 체크박스(CheckBox) / 라디오버튼(RadioButton) (0) | 2009.08.21 |
94. 버튼 / 레이블 / 텍스트박스 (Button / Label / TextBox) (0) | 2009.08.21 |
(테스트) 인터넷쇼핑몰 - WinForm을 이용하여 회원으로부터 회원번호, 주문상품코드, 주문수량을 입력받아 결과를 출력하는 프로그램 (0) | 2009.08.21 |