feat: keybinds
This commit is contained in:
16
CarManagerV2/CarDetailsForm.Designer.cs
generated
16
CarManagerV2/CarDetailsForm.Designer.cs
generated
@@ -118,7 +118,7 @@
|
||||
this.tbxMake.Location = new System.Drawing.Point(68, 203);
|
||||
this.tbxMake.Name = "tbxMake";
|
||||
this.tbxMake.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxMake.TabIndex = 2;
|
||||
this.tbxMake.TabIndex = 1;
|
||||
this.tbxMake.TextChanged += new System.EventHandler(this.tbxMake_TextChanged);
|
||||
//
|
||||
// label2
|
||||
@@ -136,7 +136,7 @@
|
||||
this.tbxModel.Location = new System.Drawing.Point(68, 233);
|
||||
this.tbxModel.Name = "tbxModel";
|
||||
this.tbxModel.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxModel.TabIndex = 4;
|
||||
this.tbxModel.TabIndex = 2;
|
||||
this.tbxModel.TextChanged += new System.EventHandler(this.tbxModel_TextChanged);
|
||||
//
|
||||
// label3
|
||||
@@ -194,7 +194,7 @@
|
||||
this.btnSave.Location = new System.Drawing.Point(450, 8);
|
||||
this.btnSave.Name = "btnSave";
|
||||
this.btnSave.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnSave.TabIndex = 0;
|
||||
this.btnSave.TabIndex = 7;
|
||||
this.btnSave.Text = "Save";
|
||||
this.btnSave.UseVisualStyleBackColor = true;
|
||||
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||
@@ -204,7 +204,7 @@
|
||||
this.btnDelete.Location = new System.Drawing.Point(369, 8);
|
||||
this.btnDelete.Name = "btnDelete";
|
||||
this.btnDelete.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnDelete.TabIndex = 1;
|
||||
this.btnDelete.TabIndex = 8;
|
||||
this.btnDelete.Text = "Delete";
|
||||
this.btnDelete.UseVisualStyleBackColor = true;
|
||||
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
|
||||
@@ -228,7 +228,7 @@
|
||||
0});
|
||||
this.nudYear.Name = "nudYear";
|
||||
this.nudYear.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudYear.TabIndex = 10;
|
||||
this.nudYear.TabIndex = 3;
|
||||
this.nudYear.ValueChanged += new System.EventHandler(this.nudYear_ValueChanged);
|
||||
//
|
||||
// tbxColor
|
||||
@@ -237,7 +237,7 @@
|
||||
this.tbxColor.Location = new System.Drawing.Point(68, 293);
|
||||
this.tbxColor.Name = "tbxColor";
|
||||
this.tbxColor.Size = new System.Drawing.Size(473, 22);
|
||||
this.tbxColor.TabIndex = 11;
|
||||
this.tbxColor.TabIndex = 4;
|
||||
this.tbxColor.TextChanged += new System.EventHandler(this.tbxColor_TextChanged);
|
||||
//
|
||||
// nudMileage
|
||||
@@ -250,7 +250,7 @@
|
||||
0});
|
||||
this.nudMileage.Name = "nudMileage";
|
||||
this.nudMileage.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudMileage.TabIndex = 12;
|
||||
this.nudMileage.TabIndex = 5;
|
||||
this.nudMileage.ThousandsSeparator = true;
|
||||
this.nudMileage.ValueChanged += new System.EventHandler(this.nudMileage_ValueChanged);
|
||||
//
|
||||
@@ -265,7 +265,7 @@
|
||||
0});
|
||||
this.nudPrice.Name = "nudPrice";
|
||||
this.nudPrice.Size = new System.Drawing.Size(120, 22);
|
||||
this.nudPrice.TabIndex = 13;
|
||||
this.nudPrice.TabIndex = 6;
|
||||
this.nudPrice.ThousandsSeparator = true;
|
||||
this.nudPrice.ValueChanged += new System.EventHandler(this.nudPrice_ValueChanged);
|
||||
//
|
||||
|
||||
@@ -94,5 +94,24 @@ namespace CarManagerV2
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||
{
|
||||
if (keyData == Keys.Enter)
|
||||
{
|
||||
btnSave.PerformClick();
|
||||
return true; // Indicate that the key has been handled
|
||||
}
|
||||
if (keyData == Keys.Escape)
|
||||
{
|
||||
this.Close();
|
||||
return true; // Indicate that the key has been handled
|
||||
}
|
||||
if (keyData == Keys.Delete)
|
||||
{
|
||||
btnDelete.PerformClick();
|
||||
return true; // Indicate that the key has been handled
|
||||
}
|
||||
return base.ProcessCmdKey(ref msg, keyData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user