Ctrl+S save 로직 만들때

Posted by RAY.D
2015. 8. 24. 14:13 Language/C#
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Set

myForm.KeyPreview = true;

Create a handler for the KeyDown event:

myForm.KeyDown += new KeyEventHandler(Form_KeyDown);

Example of handler:

    // Hot keys handler
    void Form_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.Control && e.KeyCode == Keys.S)       // Ctrl-S Save
        {
            // Do what you want here
            e.SuppressKeyPress = true;  // Stops bing! Also sets handled which stop event bubbling
        }
    }