Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 8, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Change the MousePointer to Prevent User Input

Because setting the MousePointer property for a form only changes the shape and does not prevent the application from accepting user input from the mouse or keyboard, I have developed this tip.

The tip works on an MDI form where there may be several open child windows, and you need to disable one or all of the windows during long processing periods (e.g., long database updates). If you have only one MDI child open or need to disable only one form, you can disable it by setting the Enabled property to False. If you have several child forms open, create a collection of forms and scroll through the collection, disabling each form again by setting the Enabled property to False. When the selected forms are disabled, set the MousePointer property for the MDI parent to an hourglass. This will prevent user input from the mouse or the keyboard until you reverse the process by enabling the forms and changing the mouse back to whatever shape it was before.

The real trick involves setting the MDI parent's mouse icon to the hourglass shape. If you just set the MousePointer for the child form(s) to an hourglass and then disable the child form(s), the pointer will turn back into the default shape.

Al Gehrig,
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date