473,387 Members | 1,535 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.

static Cursor

I load my custom cursor with the constructor call

System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms(GetType(),"MyCursor.Cur");

and the appropriate command line

csc -target:winexe -res:MyCursor.Cur,MyNamespace.MyCursor.Cur *.cs

This works well. But if I want to have a static cursor, I cannot use
GetType(). Fortunately there is another constructor that does without
GetType():

System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms("MyCursor.Cur");

and the same command line. This also works well. But the problem is, in the
latter case, when I move the application out of original directory, the app
crashes. In the former case the resource is correctly linked in and I can
run the program from any directory.

How can I embed a static cursor in my application and run it from anywhere?

(The program size reveals that in the latter case the cursor IS embedded in
the app, but is not used, apperently)
Nov 6 '06 #1
1 2266
Martijn Mulder <i@mwrote:
I load my custom cursor with the constructor call

System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms(GetType(),"MyCursor.Cur");

and the appropriate command line

csc -target:winexe -res:MyCursor.Cur,MyNamespace.MyCursor.Cur *.cs

This works well. But if I want to have a static cursor, I cannot use
GetType(). Fortunately there is another constructor that does without
GetType():

System.Windows.Forms.Cursor mycursor=new
System.Windows.Forms("MyCursor.Cur");

and the same command line. This also works well. But the problem is, in the
latter case, when I move the application out of original directory, the app
crashes. In the former case the resource is correctly linked in and I can
run the program from any directory.

How can I embed a static cursor in my application and run it from anywhere?

(The program size reveals that in the latter case the cursor IS embedded in
the app, but is not used, apperently)
Use typeof(...) to get a Type reference.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 6 '06 #2

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

Similar topics

5
by: Gustavo Randich | last post by:
Hello, I need to know what's wrong in this translation from Informix. Note the difference in the results, which is due to the UPDATE statement. ORIGINAL PROGRAM (INFORMIX):...
2
by: superseed | last post by:
Hi, I'm pretty new to C#, and I'm quite stuck on the following problem. I would like to add to my application a Windows.Form (singleton) on which I could display a message of one of the...
10
by: Just Me | last post by:
Does Me.Cursor.Current=Cursors.WaitCursor set the current property of Me.Cursor to Cursors.WaitCursor And Me.Cursor.Current=Cursors.Default set the Me.Current property to something (default)...
3
by: schwartzenberg | last post by:
Dear friends, I have just run into a strange DB2 problem. Something i'd some of you would answer, if only shortly. My basic question is: How do i ensure 'insensitive' (ie static) cursors...
0
by: Martijn Mulder | last post by:
I load my custom cursor with the constructor call System.Windows.Forms.Cursor mycursor=new System.Windows.Forms(GetType(),"MyCursor.Cur"); and the appropriate command line csc...
10
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset...
0
by: mmones | last post by:
Hello, I 'm working with an IBM DB2 V9 database via ODBC/CLI. I've got a problem with different lock behaviour in the following constellation / configuration. 1) connection C1 and connection...
0
debasisdas
by: debasisdas | last post by:
RESTRICTIONS ON CURSOR VARIABLES ================================= Currently, cursor variables are subject to the following restrictions: Cannot declare cursor variables in a package spec. ...
0
by: walid kayrouz | last post by:
An example for my pb 1) Created a dynamic cursor : DECLARE cursor_teste CURSOR DYNAMIC FOR Select DISTINCT name from table WHERE ID = 1 OPEN cursor_teste FETCH first FROM cursor_teste ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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,...

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.