|
using System.Drawing;
using System.Windows.Forms;
using ProjectMentor.Windows.Controls;
namespace TestReadOnlyComboBox
{
/// <summary>
/// Summary description for DifferentCombos.
/// </summary>
public class DifferentCombos : System.Windows.Forms.Form
{
private ReadOnlyComboBox _combo1;
private ReadOnlyComboBox _combo2;
private ReadOnlyComboBox _combo3;
private Label _label1;
private Label _label2;
private Label _label3;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public DifferentCombos()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
_label1 = new Label();
_label1.Text = "ComboBox:";
_label1.Location = new Point(10, 20);
this.Controls.Add(_label1);
_label2 = new Label();
_label2.Text = "ComboBox disabled:";
_label2.Width = 110;
_label2.Location = new Point(10, 50);
this.Controls.Add(_label2);
_label3 = new Label();
_label3.Text = "ComboBox readonly:";
_label3.Width = 110;
_label3.Location = new Point(10, 80);
this.Controls.Add(_label3);
_combo1 = new ReadOnlyComboBox();
_combo1.Location = new Point(140, 20);
_combo1.Size = new Size(100, 21);
_combo1.TabIndex = 1;
_combo1.Items.AddRange(new object[] { "ComboBox", "blue", "green", "yellow" });
this.Controls.Add(_combo1);
_combo2 = new ReadOnlyComboBox();
_combo2.Location = new Point(140, 50);
_combo2.Size = new Size(100, 21);
_combo2.TabIndex = 1;
_combo2.Enabled = false;
_combo2.Items.AddRange(new object[] { "Enabled = false", "blue", "green", "yellow" });
this.Controls.Add(_combo2);
_combo2.SelectedIndex = 0;
_combo3 = new ReadOnlyComboBox();
this.Controls.Add(_combo3);
_combo3.Location = new Point(140, 80);
_combo3.Size = new Size(100, 21);
_combo3.TabIndex = 1;
_combo3.ReadOnly = true;
_combo3.Items.AddRange(new object[] { "ReadOnly = true", "blue", "green", "yellow" });
_combo3.SelectedIndex = 0;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form 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()
{
//
// DifferentCombos
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(272, 115);
this.Name = "DifferentCombos";
this.Text = "DifferentCombos";
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.