combox text not editable

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();
}
}
}
 
J

Jon Skeet [C# MVP]

Simon Matthews said:
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.

There is, actually - if you look at the ComboBoxStyle enumeration in
MSDN, you'll see that DropDownList is the only one which says
"Supported by the .NET Compact Framework"
 
G

Guest

Jon,

I did see this but it does not say the others are not and it seems such as
basic control requirement, with the supported by indicating support for
windows CE and why call it a combo box if it does not combine anything, there
is already a control for list boxes ?

My obvious question then would be advice on the usual way this is
implemented on wince, or are we supposed to use text or list boxes only when
designing wince interfaces ?

simon.
 
J

Jon Skeet [C# MVP]

Simon Matthews said:
I did see this but it does not say the others are not

No, but it doesn't say anywhere (that I remember) that something
*isn't* supported on the CF - it *only* says when something *is*
supported. When one thing out of three says it's supported and the
others have nothing by them, isn't it reasonable to deduce that the
others aren't supported?
and it seems such as
basic control requirement, with the supported by indicating support for
windows CE and why call it a combo box if it does not combine anything, there
is already a control for list boxes ?

The difference between a list box and a combo box on Windows CE is that
a combo box drops down. That's basically it. I don't know for sure, but
I suspect there isn't a native combo box as we know it from Windows.
My obvious question then would be advice on the usual way this is
implemented on wince, or are we supposed to use text or list boxes only when
designing wince interfaces ?

One way of working round this (and it's pretty horrible) is to put a
text box in front of a slightly wider combo box. When a combo box
selection is made, copy the value into the text box and bring the text
box back to the front. You'd need to do extra work to get it to fill
stuff in automatically etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top