V
vanderghast
Problem with TabStop set to false changed to true by VS 2008 after
compilation.
Have a Window Forms Control library project, have the default user defined
control, add one text box, one frame with two radio buttons inside it
(labels kPa and psf), check the radio button kPa. (Code below).
In VS 2008, have the visual designer for the control, click on the kPa radio
button, find its TabStop property, change it to False. Save, keep the file
open though. Run (debug version is OK). Observe that the kPa radio button
CAN get the focus by using the tab key. Get out of debug mode. Check the
TabStop property for kPa, it is still to false. Close the file from the
visual designer. Open the file from the visual designer, check the TabStop
property, for kPa, it is reported to be true.
My problem is not much with the Visual Designer not being refreshed, but by
how to keep the TabStop property of the kPa radio button to FALSE. In fact,
I, well, a user, want that radio button be accessible with the mouse, but
not with the tab key, because the scenario is a form with many of these
controls, and the tab key to cycle trough the text-box parts, NOT passing
over the 'radio buttons', since 99% of the time, kPa is the right unit, the
end user simply want to type: 2 [tab] 1.8[tab] 1.44[tab] -1.1 instead of
the actual 2 [tab][tab] 1.8 [tab][tab] 1.44[tab][tab] -1.1.
The same problem exists with the disposition inside a Win Form rather than
in a UC.
------------------------------
namespace WindowsFormsControlLibrary1
{
partial class UserControl1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 19);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(45, 20);
this.textBox1.TabIndex = 0;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(63, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(111, 45);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(6, 19);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(44, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.Text = "kPa";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(56, 19);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(39, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "psf";
this.radioButton2.UseVisualStyleBackColor = true;
//
// UserControl1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.textBox1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(183, 57);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
}
}
compilation.
Have a Window Forms Control library project, have the default user defined
control, add one text box, one frame with two radio buttons inside it
(labels kPa and psf), check the radio button kPa. (Code below).
In VS 2008, have the visual designer for the control, click on the kPa radio
button, find its TabStop property, change it to False. Save, keep the file
open though. Run (debug version is OK). Observe that the kPa radio button
CAN get the focus by using the tab key. Get out of debug mode. Check the
TabStop property for kPa, it is still to false. Close the file from the
visual designer. Open the file from the visual designer, check the TabStop
property, for kPa, it is reported to be true.
My problem is not much with the Visual Designer not being refreshed, but by
how to keep the TabStop property of the kPa radio button to FALSE. In fact,
I, well, a user, want that radio button be accessible with the mouse, but
not with the tab key, because the scenario is a form with many of these
controls, and the tab key to cycle trough the text-box parts, NOT passing
over the 'radio buttons', since 99% of the time, kPa is the right unit, the
end user simply want to type: 2 [tab] 1.8[tab] 1.44[tab] -1.1 instead of
the actual 2 [tab][tab] 1.8 [tab][tab] 1.44[tab][tab] -1.1.
The same problem exists with the disposition inside a Win Form rather than
in a UC.
------------------------------
namespace WindowsFormsControlLibrary1
{
partial class UserControl1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 19);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(45, 20);
this.textBox1.TabIndex = 0;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.radioButton2);
this.groupBox1.Controls.Add(this.radioButton1);
this.groupBox1.Location = new System.Drawing.Point(63, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(111, 45);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(6, 19);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(44, 17);
this.radioButton1.TabIndex = 0;
this.radioButton1.Text = "kPa";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(56, 19);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(39, 17);
this.radioButton2.TabIndex = 1;
this.radioButton2.Text = "psf";
this.radioButton2.UseVisualStyleBackColor = true;
//
// UserControl1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.textBox1);
this.Name = "UserControl1";
this.Size = new System.Drawing.Size(183, 57);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton1;
}
}