473,322 Members | 1,421 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,322 software developers and data experts.

Cursor Problems--Need help

Hi, I am new to this forum and i have a problem with part of my application. I did not like the cursors that you had to pick from so i made my own and found this script so that i could use them. Well the script does not work and here is the error i get, "Object reference not set to an instance of an object.". I dont get what im doing wrong but here is the code im using,

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim newCursor As New Cursor(My.Resources.ResourceManager.GetStream("C:\ My Documents\Forums\Main page\images\Cursors\Main.cur"))

Me.Cursor = newCursor
End Sub


Can somebody pleas tell me whats wrong with my code? Thanks for any help!!
Apr 22 '07 #1
8 2691
Anybody???
Apr 22 '07 #2
Try the following link:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1494279&SiteID=1

but there is example in C# code,so try to find conveter...
Apr 22 '07 #3
Hello,i solved this...try the following code:


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim newCursor As New Cursor("C:\Main.cur")

Me.Cursor = newCursor



End Sub
Apr 22 '07 #4
SammyB
807 Expert 512MB
Hello,i solved this...try the following code:


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim newCursor As New Cursor("C:\Main.cur")

Me.Cursor = newCursor



End Sub
The reference for that is http://msdn2.microsoft.com/en-us/lib...38(VS.71).aspx. Ithought that I posted it last night, but must have been in my dreams! Also, the way that you tried to do it also works, but I cannot remember how. If I remember, I'll post a tutorial.
Apr 23 '07 #5
@SammyB

I didn't knew there is example on that site..from Bluemaster posted code i removed this piece:

(My.Resources.ResourceManager.GetStream)

and it worked very well...
Apr 23 '07 #6
Thanks, I dident know msdn had that stuff on it... then again i ushally get lost on that site.
Apr 24 '07 #7
SammyB
807 Expert 512MB
Thanks, I dident know msdn had that stuff on it... then again i ushally get lost on that site.
It's very difficult, but when you get help in VB.Net, it gives you the URL, so I just used that. One of these days I'll remember how to do it with GetStream, until then, glad this helped.
Apr 24 '07 #8
SammyB
807 Expert 512MB
Hi, I am new to this forum and i have a problem with part of my application. I did not like the cursors that you had to pick from so i made my own and found this script so that i could use them. Well the script does not work and here is the error i get, "Object reference not set to an instance of an object.". I dont get what im doing wrong but here is the code im using,

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim newCursor As New Cursor(My.Resources.ResourceManager.GetStream("C:\ My Documents\Forums\Main page\images\Cursors\Main.cur"))

Me.Cursor = newCursor
End Sub

Can somebody pleas tell me whats wrong with my code? Thanks for any help!!
I figured out the Stream thing. It's simple, but you need to follow these instructions exactly:
  1. Start a new windows VB.NET app, call it CursorDemo
  2. Use the Project, Add Existing Item menu to add a Cursor file to your project. My filename was arror_r.cur, You will have to change the files of type filter to all files to see cur files.
  3. In the Solution Explorer, click on the cursor file; and in the Properties window, change the Build Action from Content to Embedded Resource.
  4. Double click on the form to create the load event and add the following line:
Expand|Select|Wrap|Line Numbers
  1. Me.Cursor = New Cursor (Me.GetType().Assembly.GetManifestResourceStream("CursorDemo.arrow_r.cur"))
Notice that my project name & cursor filename are inside the quotes.
This way you do not need to distribute the cursor file: it is embedded in your exe/pdb. Fun & Games! --Sam
Apr 24 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: joy | last post by:
I have tables: books(book_id, title, publisher_name), branches(branch_id, branch_name, address), book_copies(book_id, branch_id, no_of_copies). I want to print out branch information, so I did: ...
3
by: vivek9856 | last post by:
I am making a website and I need help promptly. Here is the code first off -----File Header.htm----- <HTML> <HEAD> <TITLE>Black Hawk Down</TITLE> </HEAD> <LINK REL=stylesheet...
3
by: ilia | last post by:
Hi All, I am a newbie in terms of Javascript, I found some code on the net to swap rows in a table using innerHTML, this works fine in Firefox but IE is complaining, after some googling around I...
7
by: Academic | last post by:
What are the different effects of the following two statements: C1.Cursor = Cursors.WaitCursor C1.Cursor.Current = Cursors.WaitCursor I believe the first replaces the entire C1.Cursor...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
4
by: bern11 | last post by:
How do you embed a custom cursor? The help says: // On the command line: // Add the following flag: // /res:CursorFileName.Cur,Namespace.CursorFileName.Cur What if you are...
4
by: louvino | last post by:
Hi, I have some links. When I click on one, a window opens but during the loading of this window, I would like the cursor is in state "wait" (using CSS : cursor : wait; ) Help me :-)
3
by: geddy | last post by:
My OS: Ubuntu 7.04 distribution Mysql: Server version: 5.0.38-Ubuntu_0ubuntu1.2-log Ubuntu 7.04 distribution mysql-python:1.2.2 python:2.5 when I run the following script: import MySQLdb conn...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.