|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Test
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private ImageComboBox.ImageComboBox imageComboBox1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton simpleRadioButton;
private System.Windows.Forms.RadioButton dropDownRadioButton;
private System.Windows.Forms.RadioButton DropDownListRadioButton;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <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()
{
this.components = new System.ComponentModel.Container();
ImageComboBox.ImageComboBoxItem imageComboBoxItem1 = new ImageComboBox.ImageComboBoxItem();
ImageComboBox.ImageComboBoxItem imageComboBoxItem2 = new ImageComboBox.ImageComboBoxItem();
ImageComboBox.ImageComboBoxItem imageComboBoxItem3 = new ImageComboBox.ImageComboBoxItem();
ImageComboBox.ImageComboBoxItem imageComboBoxItem4 = new ImageComboBox.ImageComboBoxItem();
ImageComboBox.ImageComboBoxItem imageComboBoxItem5 = new ImageComboBox.ImageComboBoxItem();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.imageComboBox1 = new ImageComboBox.ImageComboBox();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.simpleRadioButton = new System.Windows.Forms.RadioButton();
this.dropDownRadioButton = new System.Windows.Forms.RadioButton();
this.DropDownListRadioButton = new System.Windows.Forms.RadioButton();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// imageComboBox1
//
this.imageComboBox1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
this.imageComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this.imageComboBox1.ImageList = this.imageList1;
this.imageComboBox1.ImageMember = "";
imageComboBoxItem1.Font = new System.Drawing.Font("Mistral", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
imageComboBoxItem1.Image = "0";
imageComboBoxItem1.ImageIndex = 0;
imageComboBoxItem1.Item = null;
imageComboBoxItem1.Text = "ImageComboBoxItem0";
imageComboBoxItem2.Font = new System.Drawing.Font("Myriad Web", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
imageComboBoxItem2.Image = "2";
imageComboBoxItem2.ImageIndex = 2;
imageComboBoxItem2.Item = null;
imageComboBoxItem2.Text = "ImageComboBoxItem1";
imageComboBoxItem3.Font = new System.Drawing.Font("National First Font Dotted", 18F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
imageComboBoxItem3.Image = "6";
imageComboBoxItem3.ImageIndex = 6;
imageComboBoxItem3.Item = null;
imageComboBoxItem3.Text = "ImageComboBoxItem2";
imageComboBoxItem4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
imageComboBoxItem4.Image = "3";
imageComboBoxItem4.ImageIndex = 3;
imageComboBoxItem4.Item = null;
imageComboBoxItem4.Text = "ImageComboBoxItem3";
imageComboBoxItem5.Font = new System.Drawing.Font("Pristina", 18F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
imageComboBoxItem5.Image = "7";
imageComboBoxItem5.ImageIndex = 7;
imageComboBoxItem5.Item = null;
imageComboBoxItem5.Text = "ImageComboBoxItem4";
this.imageComboBox1.Items.AddRange(new ImageComboBox.ImageComboBoxItem[] {
imageComboBoxItem1,
imageComboBoxItem2,
imageComboBoxItem3,
imageComboBoxItem4,
imageComboBoxItem5});
this.imageComboBox1.Location = new System.Drawing.Point(48, 48);
this.imageComboBox1.Name = "imageComboBox1";
this.imageComboBox1.Size = new System.Drawing.Size(121, 150);
this.imageComboBox1.TabIndex = 0;
this.imageComboBox1.Text = "imageComboBox1";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.DropDownListRadioButton);
this.groupBox1.Controls.Add(this.dropDownRadioButton);
this.groupBox1.Controls.Add(this.simpleRadioButton);
this.groupBox1.Location = new System.Drawing.Point(192, 64);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(120, 112);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Styles";
//
// simpleRadioButton
//
this.simpleRadioButton.Checked = true;
this.simpleRadioButton.Location = new System.Drawing.Point(8, 24);
this.simpleRadioButton.Name = "simpleRadioButton";
this.simpleRadioButton.TabIndex = 0;
this.simpleRadioButton.TabStop = true;
this.simpleRadioButton.Text = "Simple";
this.simpleRadioButton.CheckedChanged += new System.EventHandler(this.simpleRadioButton_CheckedChanged);
//
// dropDownRadioButton
//
this.dropDownRadioButton.Location = new System.Drawing.Point(8, 48);
this.dropDownRadioButton.Name = "dropDownRadioButton";
this.dropDownRadioButton.TabIndex = 1;
this.dropDownRadioButton.Text = "DropDown";
this.dropDownRadioButton.CheckedChanged += new System.EventHandler(this.dropDownRadioButton_CheckedChanged);
//
// DropDownListRadioButton
//
this.DropDownListRadioButton.Location = new System.Drawing.Point(8, 72);
this.DropDownListRadioButton.Name = "DropDownListRadioButton";
this.DropDownListRadioButton.TabIndex = 2;
this.DropDownListRadioButton.Text = "DropDownList";
this.DropDownListRadioButton.CheckedChanged += new System.EventHandler(this.DropDownListRadioButton_CheckedChanged);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(344, 266);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.imageComboBox1);
this.Name = "Form1";
this.Text = "Form1";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void simpleRadioButton_CheckedChanged(object sender, System.EventArgs e)
{
if(simpleRadioButton.Checked)
imageComboBox1.DropDownStyle = ComboBoxStyle.Simple;
}
private void dropDownRadioButton_CheckedChanged(object sender, System.EventArgs e)
{
if(dropDownRadioButton.Checked)
imageComboBox1.DropDownStyle = ComboBoxStyle.DropDown;
}
private void DropDownListRadioButton_CheckedChanged(object sender, System.EventArgs e)
{
if(DropDownListRadioButton.Checked)
imageComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
}
}
}
|
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.