Пример #1
0
 public static void SetCursor(Control control, Cursor cursor)
 {
     if (control.InvokeRequired)
     {
         SetCursorCallback callback = new SetCursorCallback(SetCursor);
         control.BeginInvoke(callback, new object[] { control, cursor });
     }
     else
     {
         control.Cursor = cursor;
     }
 }
Пример #2
0
 public void setCursorState(bool cursorState)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.progressBarProgressInformation.InvokeRequired)
     {
         SetCursorCallback d = new SetCursorCallback(setCursorState);
         this.Invoke(d, new object[] { cursorState });
     }
     else
     {
         this.UseWaitCursor = cursorState;
     }
 }
Пример #3
0
 private void onCursorSet()
 {
     if (_requestedCursor != null)
     {
         if (Pane.Control.InvokeRequired)
         {
             var d = new SetCursorCallback(onCursorSet);
             Pane.Control.Invoke(d);
         }
         else
         {
             Pane.Control.Cursor = _requestedCursor;
         }
     }
 }
Пример #4
0
 private void ChangeCursor(Cursor cursor)
 {
     if (this.InvokeRequired)
     {
         SetCursorCallback d = new SetCursorCallback(ChangeCursor);
         if (this.IsHandleCreated && !this.IsDisposed)
         {
             try
             {
                 this.Invoke(d, new object[] { cursor });
             }
             catch { }
         }
     }
     else
     {
         this.Cursor = cursor;
     }
 }
 private void ChangeCursor(Cursor cursor)
 {
     if (this.InvokeRequired)
     {
         SetCursorCallback d = new SetCursorCallback(ChangeCursor);
         if (this.IsHandleCreated && !this.IsDisposed)
         {
             try
             {
                 this.Invoke(d, new object[] { cursor });
             }
             catch { }
         }
     }
     else
     {
         this.Cursor = cursor;
     }
 }
 public void setCursorState(bool cursorState)
 {
     // InvokeRequired required compares the thread ID of the
     // calling thread to the thread ID of the creating thread.
     // If these threads are different, it returns true.
     if (this.progressBarProgressInformation.InvokeRequired)
     {
         SetCursorCallback d = new SetCursorCallback(setCursorState);
         this.Invoke(d, new object[] { cursorState });
     }
     else
     {
         this.UseWaitCursor = cursorState;
     }
 }
Пример #7
0
        /// <summary>
        /// Calls the parent (via interface, if implemented) to change the cursor used
        /// </summary>
        /// <param name="cursor">Cursor to use</param>
        public void SetCursor(System.Windows.Forms.Cursor cursor)
        {
            SetCursorCallback d = new SetCursorCallback(SetCursorUnsafe);

            this.Invoke(d, new object[] { cursor });
        }
Пример #8
0
        /// <summary>
        /// Calls the parent (via interface, if implemented) to change the cursor used
        /// </summary>
        /// <param name="cursor">Cursor to use</param>
        public void SetCursor(System.Windows.Forms.Cursor cursor)
        {
            SetCursorCallback d = new SetCursorCallback(SetCursorUnsafe);
            this.Invoke(d, new object[] { cursor });

        }