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!!
8 2691
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...
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
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.
@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...
Thanks, I dident know msdn had that stuff on it... then again i ushally get lost on that site.
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.
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: - Start a new windows VB.NET app, call it CursorDemo
- 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.
- In the Solution Explorer, click on the cursor file; and in the Properties window, change the Build Action from Content to Embedded Resource.
- Double click on the form to create the load event and add the following line:
- 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
Sign in to post your reply or Sign up for a free account.
Similar topics
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:
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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 :-)
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
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...
|
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...
| |