[Solved] “if (x == 100) alert” not working in combination with keydown function?

You should put the code inside the callback function, otherwise the nummer will just be 0. $(document).keydown(function(e) { switch (e.which) { case 38: $(“#object”).stop().animate({ top: “10” }); nummer = 0; break; case 40: $(“#object”).stop().animate({ top: “200” }); nummer = 100; break; } if (nummer == 100) { //do something it does have the protected class! … Read more

[Solved] How can I respond to a keyboard chord and replace the entered alpha key with a special one?

Here’s one way to accomplish this for all TextBoxes on your Form: public partial class Form1 : Form { public Form1() { InitializeComponent(); } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (this.ActiveControl != null && this.ActiveControl is TextBox) { string replacement = “”; TextBox tb = (TextBox)this.ActiveControl; bool useHTMLCodes = checkBoxUseHTMLCodes.Checked; if … Read more