Esempio n. 1
0
 public void ResumeDrawing()
 {
     ctrl.VerticalScroll.Value = Math.Min(ctrl.VerticalScroll.Maximum, scrollValue);
     ctrl.ResumeLayout();
     SendMessage(ctrl.Handle, WM_SETREDRAW, true, 0);
     ctrl.Refresh();
 }
Esempio n. 2
0
 /// <summary>
 /// Sets the automatic scroll position.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetAutoScrollPosition(this ScrollableControl control, Point value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetAutoScrollPosition(value)));
     }
     else
     {
         control.AutoScrollPosition = value;
         control.Refresh();
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Sets the minimum size of the automatic scroll.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="value">The value.</param>
 public static void SetAutoScrollMinSize(this ScrollableControl control, Size value)
 {
     if (control.InvokeRequired)
     {
         control.BeginInvoke(new MethodInvoker(() => control.SetAutoScrollMinSize(value)));
     }
     else
     {
         control.AutoScrollMinSize = value;
         control.Refresh();
     }
 }
        public static void RefreshControl(Control c)
        {
            ScrollableControl sc = c as ScrollableControl;

            if (sc != null)
            {
                sc.Refresh();
            }
            else
            {
                if (c != null)
                {
                    c.Refresh();
                }
            }
        }
Esempio n. 5
0
 public static void ResumeDrawing(this ScrollableControl parent)
 {
     SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
     parent.Refresh();
 }