Solved

Custom cursors in VB.NET

Posted on 2009-07-05
6
617 Views
Last Modified: 2012-05-07
Hi experts

Please help me to make 6 or so custom cursors (.CUR files already created) available in my VB.NET program.

BTW, Im posting from England where it is unusually hot. What about you guys ?

TIA, Patrick
0
Comment
Question by:patrick_otter
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:stevepicks
ID: 24780528
0
 

Author Comment

by:patrick_otter
ID: 24782992
Thanks for trying but the solution to which you linked was about setting the system cursors. I want to change cursors within an application.

Patrick

0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 24783284
Hi Patrick,

Use something like this to load your cursors from a file....

        Dim cur As New Cursor("C:\Path\Filename.cur")
        Me.Cursor = cur

BTW, I'm in northern Australia, so hot isn't that unusual :)

Wayne
0
 

Author Comment

by:patrick_otter
ID: 24825382
Thanks Wayne

Fine Wayne: that will get my program showing the cursors but I'm developing something I hope to market as shareware. Because of this, I don't really want to ship the cursors in separate files.

AIUI, it's possible to stick them in a resource and then access them from there. My probl;em is that I don't know how to do that.

I've heard about the heat in Northen Oz so ours in UK is nothing by comparision.

stay cool, man :-) regards, Patrick
0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 250 total points
ID: 24828390
To load a cursor from your resources, use something like this....

        Dim ms As New IO.MemoryStream(My.Resources.MyCursor)
        Dim cur As New Cursor(ms)

...where MyCursor is the cursor file added to the Resources tab in Project Properties.

Wayne
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET (VB) return a record 2 37
VB.NET Textbox input validation 4 37
VS 2017 18 40
reading excel file in .net 2 15
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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