학습목표: 이번 장에서는 KeyPress를 활용하여,

특정 Key가 눌러졌을때 그에 상응하는 대응 코드를 작성해 보자.

 

//하기와 같이 KeyPress Event를 활용하면 된다.

끝..

 

private void txtboxScanData_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (int)Keys.Enter)
{
string sBuf = txtboxScanData.Text;
MessageBox.Show(sBuf);
}
}

'프로그래밍 > .Net' 카테고리의 다른 글

Tab Control index change  (0) 2014.01.17
textbox 글자넣기  (0) 2014.01.17
Color class에서 문자열로 색 지정하기  (0) 2014.01.17
MainForm, ChildForm 데이터 공유  (0) 2014.01.17
Color Type(Color.)  (0) 2014.01.17

+ Recent posts