473,408 Members | 1,841 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,408 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 2268
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.