开发者

How to force character casing (capitalized) in a ComboBox C#? Is it possible?

开发者 https://www.devze.com 2023-01-09 16:54 出处:网络
I\'m using a ComboBox control (windows forms) with auto complete, and I found out that there is no CharacterCasing Property on it. What I\'m trying to accomplish is to echo upper case letters on the C

I'm using a ComboBox control (windows forms) with auto complete, and I found out that there is no CharacterCasing Property on it. What I'm trying to accomplish is to echo upper case letters on the ComboBox.


comboBox1.DropDownStyle = DropDownStyle.DropDown;

//comboBox1.CharacterCasing = CharacterCasing.Upper ???

Here's how I populate the comboBox:

ComboBox cb =开发者_Go百科 (ComboBox)sender;
                pl.cmd = new SqlCommand("LOOKUP", pl.ConnOpen());
                pl.cmd.CommandType = CommandType.StoredProcedure;
                pl.cmd.Parameters.Add(new SqlParameter("@TABLENAME", (object)tableName));
                pl.da = new SqlDataAdapter(pl.cmd);
                dt = new DataTable("dt");
                pl.da.Fill(dt);
                cb.DataSource = dt;
                cb.ValueMember = valueMember;
                cb.DisplayMember = displayMember;


Try this:

WPF ComboBox, force input to UpperCase

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号