Is there a way to jump to the method if the key pressed does not result in dialing. those. shift key, control key, etc., without specifying all of them. Ideally for detecting keyboard shortcuts like Control + V = Paste.
Code similar to the one below is what I work with;
if( (e.KeyData == Keys.Left) || (e.KeyData == Keys.Right) || (e.KeyData == Keys.Home) || (e.KeyData == Keys.End) || (e.KeyData == Keys.Up) || (e.KeyData == Keys.Down) || (e.KeyData == Keys.ShiftKey) || (e.KeyData == Keys.ControlKey) ) return;
But you do not need to add each key combination.
Any ideas?
protected override bool ProcessCmdKey( ref Message msg, Keys keyData ) { if ( keyData == (Keys.Control | Keys.V) ) return true; else return base.ProcessCmdKey( ref msg, keyData ); }
+ . OnKeyPress Char.IsDigit / Char.IsLetter( Char.IsLetterOrDigit), . , , , .
Keys . , . :
if ( (keyData & Keys.Control) == Keys.Control && (keyData & Keys.V) == Keys.V) { // Ctrl+V was pressed! }
, ... : s
: http://www.go4expert.com/forums/showthread.php?t=713
: " , - ", , , ,
TextChanged TextBox/RichTextBox. , ( ).
private void richTextBox1_TextChanged(object sender, EventArgs e) { // Handle the event. }
, , Modified .
Modified
if (richTextBox1.Modified) { // The user modified the contents of the text box. }
, , , KeyDown, KeyUp, KeyPress .. , , .
, " ", .
, unicode " " ('Cc').
Source: https://habr.com/ru/post/1775106/More articles:How to pass ViewModel data between POST requests in ASP.NET MVC? - c #Convert URLs to HTTPS via Javascript - javascriptShould I use a listener interface or handler for event callbacks in Android development? - javaHow to determine which column was clicked in a table using tablesorter? - jqueryHow to get ExtJS ComboBox to display inline text? - cssWhat does Firefox add to XULRunner? - firefoxSecondary Monitors - windowsFixed header column width in gridview? - c #Windows CryptoAPI: CryptSignHash с CALG_SHA_256 и закрытым ключом из MY keystore - cryptographyHow do you make sure you always have a ready-made assembly? - buildAll Articles