我正在制作一个配置编辑器表单并且遇到了一些问题,我花了很多时间进行用户友好和高效的设计,因此希望它TabIndex
能够完美地工作以尽量减少鼠标的使用。
我现在的问题是,当我尝试通过控件切换时,我注意到CheckBox
没有像用鼠标按下它那样获得焦点,这意味着我无法直接从键盘切换并更改它们的状态。
如何通过andCheckBox
获得焦点,这样我只需按 Enter 键即可通过 KeyUp 事件更改其状态。 TabIndex
TabStop
下面是我的表格的图片,旁边是一张图片TabIndex
以及直接取自Form.Designer.cs
班级的代码。
//
// cbxDefaultPublic
//
this.cbxDefaultPublic.AutoSize = true;
this.cbxDefaultPublic.Location = new System.Drawing.Point(247, 12);
this.cbxDefaultPublic.Name = "cbxDefaultPublic";
this.cbxDefaultPublic.Size = new System.Drawing.Size(15, 14);
this.cbxDefaultPublic.TabIndex = 1;
this.cbxDefaultPublic.TabStop = true;
this.cbxDefaultPublic.UseVisualStyleBackColor = true;
请注意,我很难解释这个原因,因为它有点复杂,如果我弄错了一些事情,我不知道如何解释它。