Default Path and Cursor files.

  • Thread starter Thread starter JohnSouth
  • Start date Start date
J

JohnSouth

Hi

I've been setting the location of a cursor file like this:

this.Cursor= new Cursor("HandCur.cur");

I've just found out (the hard way) that if, elsewhere in the
application, the user browses for a file using the openFileDialog then
the default path is changed and the application looks for the cursor
file in the last openFile path, and run-time error.

I can solve it with hard-coded paths, but is there a better way of
avoiding this problem in general?

I'd appreciate suggestions.

John South
www.wherecanwego.com
Pangbourne UK
 
John,

You can use the following

this.Cursor = new Cursor(Application.StartupPath + "HandCur.cur")

Regards
Scott Blood
C# Developer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top