Print Search Rate
    
   04-23-2003, 3:38 PM
Setting the MousePointer on the Form Object Does not Apply to SharpGrid

SharpGrid will override all settings to MousePointer properties at Form level and at Screen level. In order to overcome this problem, the SharpGrid object must be disabled. This is due to the fact that SharpGrid has a MousePointer property on each style. You can have a different MousePointer setting on cells, rows, columns, built-in styles, etc.

Below is a solution that will prevent your grids from modifying form level MousePointer settings. You will want to call this method before and after setting your mouse pointer settings.

Public Sub EnableAppGrids(ByVal blnShowEnabled As Boolean)
   '********************************
   ' place this code in modMain ***
   ' or somewhere for all to see **
   '********************************
   Dim f As VB.Form
   Dim c As VB.Control
   ' loop through each form
   For Each f In Forms
      ' loop through each control in this form
      For Each c In f.Controls
         ' if the control is a #Grid object, disable it...
         If TypeName(c) = "SGGrid" Then
            Debug.Print f.Name & "." & c.Name & ".Enabled = " & blnShowEnabled c.Enabled = blnShowEnabled
         End If
      Next c
   Next f
   ' clean up
   Set f = Nothing
   Set c = Nothing
End Sub

You should call this method:

Private Sub Command1_Click()
   Me.MousePointer = vbHourGlass
   Call EnableAppGrids(False)
   ' process code here...
   Me.MousePointer = vbDefault
   Call EnableAppGrids(True)
End Sub


GrapeCity » Frequently Aske... » SharpGrid FAQ » Setting the MousePointer on the Form Object Does not Apply to SharpGrid
Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.