Example #1
0
 /// <summary>
 /// Finds the first item in the <see cref="ComboBox"/> after the specified index that matches the specified string.
 /// </summary>
 /// <param name="cb">The <see cref="ComboBox"/> to search.</param>
 /// <param name="s">The <see cref="System.String"/> to search for.</param>
 /// <param name="startIndex">The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.</param>
 /// <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns>
 public static int FindStringExact(this ComboBox cb, string s, int startIndex)
 {
     if (InTheHand.WindowsCE.Forms.SystemSettingsInTheHand.Platform == WinCEPlatform.Smartphone)
     {
         return(ControlInTheHand.FindString(cb, NativeMethods.LB_FINDSTRINGEXACT, s, startIndex));
     }
     else
     {
         return(ControlInTheHand.FindString(cb, NativeMethods.CB_FINDSTRINGEXACT, s, startIndex));
     }
 }
Example #2
0
 /// <summary>
 /// Finds the first item in the <see cref="ListBox"/> after the specified index that matches the specified string.
 /// </summary>
 /// <param name="lb">The <see cref="ListBox"/> to search.</param>
 /// <param name="s">The <see cref="System.String"/> to search for.</param>
 /// <param name="startIndex">The zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.</param>
 /// <returns>The zero-based index of the first item found; returns -1 if no match is found.</returns>
 public static int FindStringExact(this ListBox lb, string s, int startIndex)
 {
     return(ControlInTheHand.FindString(lb, NativeMethods.LB_FINDSTRINGEXACT, s, startIndex));
 }