I want to create a input (input commands) that it have a function like intellsense. I have found on internet and I found 2 ways: use rich textbox + custom code (harder) and autocomplete combobox.
My combobox (more important properties):
AutoCompleteMod e = SuggestAppend
AutoCompleteSou rce = ListItems
DropDownStyle = Simple
DataSource = MyDataBindingSo urce
My combobox display a list of commands. When user type,...
User Profile
Collapse
-
:), I have just find the answer, I add a command, result:
But I use mouse to chose the item, text is cleared.Code:if (e.KeyValue == 13) { if (Combobox.Text != "") StringGlobal = Combobox.Text; if (Combobox.Text == "") Combobox.Text = StringGlobal; }Leave a comment:
-
Press Enter key, then Combobox clear text, how to stop it ?
Hi,
I use Combobox in DropDownStyle = simple, and AutoCompleteMod e, I bind DataSource for Combobox. So I have a Combobox AutoComplete with a list from Database.
When I use in DropDownStyle = DropDownList, it don't have problem.
But when I use it in Simple, when I chose a item by press Enter, Text of Combobox is cleared. I use PreviewKeyDown and set again text for Combobox. But there are 2 times occur this event, and text is set... -
I try this and good
private void cboOperationCod e_KeyPress(obje ct sender, KeyPressEventAr gs e)
{
if (e.KeyChar >= 'a' && e.KeyChar <= 'z')
e.KeyChar = Convert.ToChar( e.KeyChar.ToStr ing().ToUpper() );
}Last edited by Niheel; Apr 30 '12, 10:10 AM. Reason: your solution was posted, future reference this is closed for replyLeave a comment:
No activity results to display
Show More
Leave a comment: