Introduction
The compact framework has not a method for find a string in the combo box, but native code has support. So we can bring that feature by doing P/Invoke into our application.
C# code
{codecitation class="brush: c#; gutter: true;" width="600px"} public const int CB_FINDSTRINGEXACT = 0x0158;
[DllImport("coredll.dll")] internal static extern int SendMessage(IntPtr hWnd, int msg, int wParam, string lParam);
private void FindStringExact(string find) { int m = SendMessage(comboBox1.Handle, CB_FINDSTRINGEXACT, 0, find + "\0"); if (m > 0) { MessageBox.Show("string is found "); } else { MessageBox.Show("string not found"); } } {/codecitation}
Thank you RRaveen |