G
Guest
I cannot seem to change the comboBoxStyle in WIndowsCE projects .net
I can add a combox box but the DropDownStyle property can only be set to
DropDownList not DropDown which I is what I need.
The reason it cannot be set is because there is only one value for
comboBoxStyle that can be chosen and compiled, when there should be three.
ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
cannot be changed to any other value than DropDownList.
There is no mention this is not supported under windows CE.
I have inlcuded the full code from a quick test project I created below. The
line
Any help woud be appreciated .
------------------------------------------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
namespace testcombobox
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button Exit;
private System.Windows.Forms.MainMenu mainMenu1;
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 )
{
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.mainMenu1 = new System.Windows.Forms.MainMenu();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.Exit = new System.Windows.Forms.Button();
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(16, 24);
this.comboBox1.Size = new System.Drawing.Size(100, 21);
//
// Exit
//
this.Exit.Location = new System.Drawing.Point(160, 232);
this.Exit.Text = "Exit";
this.Exit.Click += new System.EventHandler(this.Exit_Click);
//
// Form1
//
this.Controls.Add(this.Exit);
this.Controls.Add(this.comboBox1);
this.Menu = this.mainMenu1;
this.Text = "Form1";
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load()
{
comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
}
private void Exit_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}
I can add a combox box but the DropDownStyle property can only be set to
DropDownList not DropDown which I is what I need.
The reason it cannot be set is because there is only one value for
comboBoxStyle that can be chosen and compiled, when there should be three.
ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
cannot be changed to any other value than DropDownList.
There is no mention this is not supported under windows CE.
I have inlcuded the full code from a quick test project I created below. The
line
Any help woud be appreciated .
------------------------------------------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
namespace testcombobox
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button Exit;
private System.Windows.Forms.MainMenu mainMenu1;
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 )
{
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.mainMenu1 = new System.Windows.Forms.MainMenu();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.Exit = new System.Windows.Forms.Button();
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(16, 24);
this.comboBox1.Size = new System.Drawing.Size(100, 21);
//
// Exit
//
this.Exit.Location = new System.Drawing.Point(160, 232);
this.Exit.Text = "Exit";
this.Exit.Click += new System.EventHandler(this.Exit_Click);
//
// Form1
//
this.Controls.Add(this.Exit);
this.Controls.Add(this.comboBox1);
this.Menu = this.mainMenu1;
this.Text = "Form1";
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load()
{
comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
}
private void Exit_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}