SyntaxHighlighter.all();

enter키로 버튼클릭 이벤트를 발생시키는 방법입니다. 

 

 

pw의 textBox에 포커스가 있을 때, enter을 입력하면 ok버튼이 클릭됩니다(submit).

 

1
2
3
4
5
6
7
8
9
10
11
private void Btn_LoginForm_Ok_Click(object sender, EventArgs e)
{
    MessageBox.Show("enter!");
    this.Close();
}
 
private void Tb_Loginform_Pw_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
        Btn_LoginForm_Ok_Click(sender, e);
}
 
 
반응형
1
2
3
4
5
6
7
8
9
10
11
12
public static byte[] HexToByte(string hex)
{
            byte[] convert = new byte[hex.Length / 2];
 
            int length = convert.Length;
            for (int i = 0; i < length; i++)
            {
                convert[i] = Convert.ToByte(hex.Substring(i * 2), 16);
            }
 
            return convert;
}
 
 
반응형

 

1
2
3
4
5
public static string ByteToHex(byte[] bytes)
{
            string hex = BitConverter.ToString(bytes);
            return hex.Replace("-""");
 }
 
 

 

출처 : https://codeclu.com/questions/69/byte-hex-%EB%B3%80%ED%99%98

반응형

+ Recent posts