473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Setting Cursor in Class

how can we set mouse pointer in a class (not in form ) in C# ?

Lalit
Jul 21 '05 #1
3 1218
Hi Lalit

I would suggest that if your class is not a form, i.e. does not have its own
user interface, then you possibly should not be setting the cursor. Consider
raising an event (Waiting, say) to notify the owner of the class object that
something has happened that requires the user to be informed of a delay. The
owner, presumably a form with a user interface, can then set the cursor.
When the task is complete, raise another event (Waited, say) and the parent
can reset the cursor.

HTH

Charles
"Lalit Bhatia" <xy*@abc.com> wrote in message
news:Oa**************@TK2MSFTNGP14.phx.gbl...
how can we set mouse pointer in a class (not in form ) in C# ?

Lalit

Jul 21 '05 #2
Hi,

Yes, you are write but I have to do it this way only.
My code is called from Main function once the processing of all forms is
finished.
Here I save data to the database.

Lalit

"Charles Law" <bl***@nowhere.com> wrote in message
news:#P**************@tk2msftngp13.phx.gbl...
Hi Lalit

I would suggest that if your class is not a form, i.e. does not have its own user interface, then you possibly should not be setting the cursor. Consider raising an event (Waiting, say) to notify the owner of the class object that something has happened that requires the user to be informed of a delay. The owner, presumably a form with a user interface, can then set the cursor.
When the task is complete, raise another event (Waited, say) and the parent can reset the cursor.

HTH

Charles
"Lalit Bhatia" <xy*@abc.com> wrote in message
news:Oa**************@TK2MSFTNGP14.phx.gbl...
how can we set mouse pointer in a class (not in form ) in C# ?

Lalit


Jul 21 '05 #3
Why can't you set the cursor in the Main code just before you call your
code?

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor...
3
by: Lalit Bhatia | last post by:
how can we set mouse pointer in a class (not in form ) in C# ? Lalit
2
by: Peteroid | last post by:
This seems like it should be an easy task, but I just can't find the info on it. MSDN2 shows an example where the cursor is changed to the system default Cursors::Hand, but not how to make a custom...
5
by: Paul Cheetham | last post by:
Hi, I have some custom colour cursors which I have added to my c# project, and set them to be compiled as "Embedded Resource" It seems impossible to load a colour cursor using the standard...
7
by: Academic | last post by:
What are the different effects of the following two statements: C1.Cursor = Cursors.WaitCursor C1.Cursor.Current = Cursors.WaitCursor I believe the first replaces the entire C1.Cursor...
12
by: info | last post by:
Hi All, I am trying to set the hourglass cursor inside a class that has nothing to do with MainForm class and I don't want to pass a reference to MainForm. How can I set the current cursor to...
4
by: David Veeneman | last post by:
I'm creating a UserControl that uses a LinkLabel. For reasons that I won't bore everyone with, I don't want the LinkLable to show the default hand cursor when the mouse enters the control. Should...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.