Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:17:16+00:00 2026-05-11T04:17:16+00:00

Suppose that for every Form in a WinForms application, you want to change the

  • 0

Suppose that for every Form in a WinForms application, you want to change the cursor to the WaitCursor. The obvious way to do this would be to add the code to every place where a form is instantiated/shown:

Try     Me.Cursor = Cursors.WaitCursor      Dim f As New frmMyForm     f.Show()  Catch ex As Exception     Throw Finally     Me.Cursor = Cursors.Default End Try 

However, I was wondering if there is a way to tell your application, ‘Whenever any form Load event fires, show a WaitCursor. When the form event Shown is complete, set the cursor back to Default.’ This way, the Me.Cursor code could be only in one place and not scattered throughout the application – and not forgotten to put it in to each form instantiation.

I suppose you could subclass the regular Form class and add the cursor settings in an overridden event, but I believe you lose the visual designer capability when you subclass the Form object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:17:16+00:00Added an answer on May 11, 2026 at 4:17 am

    To answer your question – there are no global .Net events to achieve what you want. There isn’y any pure .net solution to this. You could take a look at Aspect Orientated Programming and Cross Cutting Concerns – there may be an AOP solution to this (some googling will get you started then post back here for details).

    However, what follows is more of an idea rather than a complete solution as to how you might achieve this using win32 messaging.

    1. You need to work out which win32 messages correspond to the Load event and if there is a win32 message that always happens after the load event. One candidate for the load event might be WM_SHOWWINDOW but I’m not sure.
    2. Write a message filter class (i.e. implement IMessageFilter).
    3. In the message filter class’s PreMessageFilter method check the message type and if it is a WM_SHOWWINDOW (or whatever) message with the correct paramters then you can set/reset the cursor (using Cursor.Current = Cursors.WaitCursor – again you need to test this)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been wondering, suppose I have a model with an attribute that in every
Suppose that you have to set 12 cookies, would it be better to store
Suppose that I have an integer variable in a class, and this variable may
I suppose this isn't a huge deal, since there are other way around this
I want to submit a form using jQuery in a CodeIgniter application. However, the
suppose that no bytecode is generated for a program, like in Ruby, Perl, or
Suppose that I have a request handler that accepts an argument: key And let
Suppose that I define some class: class Pixel { public: Pixel(){ x=0; y=0;}; int
Suppose that there're two types of packet in the chatting server. Those two packets
Suppose that my index has 3 fields: title, x and y. I know one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.