示例#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));
     }
 }
 /// <summary>
 /// Supports multi-line text on the Button control (to match default behaviour on the desktop).
 /// </summary>
 /// <param name="button">The button to update.</param>
 public static void SetMultiline(this ButtonBase button)
 {
     ControlInTheHand.ModifyStyles(button.Handle, BS_MULTILINE, 0);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="progressBar"></param>
 /// <param name="value"></param>
 /// <remarks>
 /// <list type="table"><listheader><term>Platforms Supported</term><description></description></listheader>
 /// <item><term>Windows Embedded Compact</term><description>Windows CE 6.0 and later</description></item>
 /// </list>
 /// </remarks>
 public static void SetMarqueeStyle(this ProgressBar progressBar, bool value)
 {
     ControlInTheHand.ModifyStyles(progressBar.Handle, value ? PBS_MARQUEE : ~PBS_MARQUEE, value ? ~PBS_MARQUEE : PBS_MARQUEE);
     NativeMethods.SendMessage(progressBar.Handle, PBM_SETMARQUEE, value ? 1 : 0, 100);
 }
示例#4
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));
 }