Solved

chang pointer in windows app

Posted on 2009-05-15
11
249 Views
Last Modified: 2013-12-17
I am working on a windows app and I want to change the pointer however I cant find where to add new Cursor. I have seen in the properties But I dont know where to add new ones to the VS database so it can be slectable other than the standard choices VS gives you. Does anyone have any ideas??
0
Comment
Question by:HawaiiDragon
  • 6
  • 5
11 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 24399284
The simplest way:

Go to Project->Add New Item->General->Cursor File

Then draw your cursor. In Solution Explorer, select you new cursor file and hit F4 to bring up Properties Window. Set the "Build Action" to "Content" and "Copy to Output" to either of the copy options. Then in your code, do something like the following:
this.Cursor = new Cursor("Cursor1.cur");  // Where Cursor1.cur is the name of the new cursor file you created

Open in new window

0
 

Author Comment

by:HawaiiDragon
ID: 24399686
I have an existing image I want to use how do I do that?
0
 

Author Comment

by:HawaiiDragon
ID: 24399702
I am also getting an error "File Not Found Exception: this is what i have done
namespace wackaemployee

{

    public partial class Form1 : Form

    {
 

      

 
 

        public Form1()

        {

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

            InitializeComponent();

        }
 

        private void button1_Click(object sender, EventArgs e)

        {

            System.Diagnostics.Process.Start("mailto

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24399792
Instead of doing "Add New Item," do "Add Existing Item." Then browse to your cursor file. In your last post, "Cursor1.cur" was the name of a file on my system--and it was just for demonstration. When you browse to your cursor file, you will change "Cursor1.cur" in the last post to "whatever you named it.cur".
0
 

Author Comment

by:HawaiiDragon
ID: 24399824
but where do I add it so there is not an error I tired in public partial class Form1 : Form but it exceptions out
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24399844
Did you do Project->Add Existing Item? Once you do that, select the file that was added in Solution Explorer, then press F4 to bring up properties window. Change Build Action to "Content" and Copy to Output to one of the options relating to copying (Copy Always or Copy If Newer).
0
 

Author Comment

by:HawaiiDragon
ID: 24399865
yes and I put it in the publc Form1 () method so it would be loaded wih the form but when i try to run it it execptions out


        public Form1()

        {

               this.Cursor = new Cursor("stick3.png");  

            InitializeComponent();

        }

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24399887
Put line 3 after line 4. Like so:
public Form1()

{

    InitializeComponent();

    this.Cursor = new Cursor("stick3.png");  

}

Open in new window

0
 

Author Comment

by:HawaiiDragon
ID: 24415158
im still getting an exception error.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 24421165
What is the exception message you receive?
0
 

Author Comment

by:HawaiiDragon
ID: 24423004
its a file noe found exception please see atached screen shot
exception.doc
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now