private void UpdateUpDown()
 {
     if (this.ShowUpDown)
     {
         EnumChildren wrapper = new EnumChildren();
         System.Windows.Forms.NativeMethods.EnumChildrenCallback lpEnumFunc = new System.Windows.Forms.NativeMethods.EnumChildrenCallback(wrapper.enumChildren);
         System.Windows.Forms.UnsafeNativeMethods.EnumChildWindows(new HandleRef(this, base.Handle), lpEnumFunc, System.Windows.Forms.NativeMethods.NullHandleRef);
         if (wrapper.hwndFound != IntPtr.Zero)
         {
             System.Windows.Forms.SafeNativeMethods.InvalidateRect(new HandleRef(wrapper, wrapper.hwndFound), (System.Windows.Forms.NativeMethods.COMRECT)null, true);
             System.Windows.Forms.SafeNativeMethods.UpdateWindow(new HandleRef(wrapper, wrapper.hwndFound));
         }
     }
 }
Ejemplo n.º 2
0
 /// <devdoc>
 ///     Forces a repaint of the updown control if it is displayed.
 /// </devdoc>
 /// <internalonly/>
 private void UpdateUpDown() {
     // The upDown control doesn't repaint correctly.
     //
     if (ShowUpDown) {
         EnumChildren c = new EnumChildren();
         NativeMethods.EnumChildrenCallback cb = new NativeMethods.EnumChildrenCallback(c.enumChildren);
         UnsafeNativeMethods.EnumChildWindows(new HandleRef(this, Handle), cb, NativeMethods.NullHandleRef);
         if (c.hwndFound != IntPtr.Zero) {
             SafeNativeMethods.InvalidateRect(new HandleRef(c, c.hwndFound), null, true);
             SafeNativeMethods.UpdateWindow(new HandleRef(c, c.hwndFound));
         }
     }
 }
 private void UpdateUpDown()
 {
     if (this.ShowUpDown)
     {
         EnumChildren wrapper = new EnumChildren();
         System.Windows.Forms.NativeMethods.EnumChildrenCallback lpEnumFunc = new System.Windows.Forms.NativeMethods.EnumChildrenCallback(wrapper.enumChildren);
         System.Windows.Forms.UnsafeNativeMethods.EnumChildWindows(new HandleRef(this, base.Handle), lpEnumFunc, System.Windows.Forms.NativeMethods.NullHandleRef);
         if (wrapper.hwndFound != IntPtr.Zero)
         {
             System.Windows.Forms.SafeNativeMethods.InvalidateRect(new HandleRef(wrapper, wrapper.hwndFound), (System.Windows.Forms.NativeMethods.COMRECT) null, true);
             System.Windows.Forms.SafeNativeMethods.UpdateWindow(new HandleRef(wrapper, wrapper.hwndFound));
         }
     }
 }