Use the carriage return instead of the TAB key function code

xiaoxiao2021-03-06  79

///

/ / / Keyboard processing event

/// The functionality of the main implementation is to rewrite the keyboard command event. When using the user is in use, if the current focus is not on the Button (button), you can use Enter instead of the TAB button.

///

///

///

///

Protected Override Bool ProcessCmdkey (Ref Message MSG, Keys KeyData)

{

IF ((ActiveControl Is Button) && (KeyData == Keys.up || KeyData == Keys.down || KeyData == Keys.Enter)

{

if (KeyData == Keys.enter)

{

System.windows.Forms.sendKeys.send ("{tab}");

Return True;

}

if (KeyData == Keys.down)

System.windows.Forms.sendKeys.send ("{tab}");

Else

SendKeys.send (" {tab}");

Return True;

}

Else

Return Base.ProcessCmdKey (Ref Msg, KeyData);

}

转载请注明原文地址:https://www.9cbs.com/read-108314.html

New Post(0)