Solved

chang pointer in windows app

Posted on 2009-05-15
11
247 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 74

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 74

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 74

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 74

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 74

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

18 Experts available now in Live!

Get 1:1 Help Now