vendredi 2 avril 2021

How to check checkboxes with "KeyCode"? ( Windows Forms Application )

i have to check checkboxes with "KeyCode". ( Hotkey ) I tried it but it has some errors... i hope you guys can help me :)

        private void NotYetHAX_Load(object sender, EventArgs e)
        {
            this.KeyPreview = true;
        }

        private void HotKey_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            if (e.KeyCode == Keys.K)
            {
                checkbox1.Checked();
            }
            else
            {
                checkbox.Checked = false();
            }
        }



Aucun commentaire:

Enregistrer un commentaire