Hi, I'm trying to sort the wheat from the chaff with so many examples of 'How to load custom Cursor Images' into a project. I am trying to import 8 new, sequentially numbered, cursors into my project. I would like to add and allocate them, one each to a Label in a TableLayoutPanel, using a loop, but can't discover how to enter even one.
When I've done something similar with Images for PictureBoxes, I've used:
And had no trouble with Line 3, however when I try:
Whilst I'm typing Line 3, "Cur = My.Resources." , as I type the '.' after Resources I'm presented with a drop-down menu of choices... amongst which are all my custom cursors from Cursor0 to Cursor7, in this case I selected Cursor0, and it's accepted it as you can see...
However, having 'entered' the line, that red 'squiggly' error under-line appears. Hovering the cursor over it I get the message: "Value of type 'System.Drawing.Bitmap' cannot be converted to 'System.Windows.Form.Cursor'."
So I changed it to:
And got another red Squiggle, this time is says : "End of statement expected." but I can't find what it's asking for.
So I tried:
Which is accepted, but now I can't find how to get from 'Object' to 'Cursor'.
There are loads of examples of how to do something similar, usually with only one or two cursors, and I've not yet found one which specifically allocates them to a control, I've tried each one as I've found it but I'm getting nowhere...
Poppa.
Win.7 Pro. 64bit
8 Gig RAM
Quad core processor.
When I've done something similar with Images for PictureBoxes, I've used:
vb.net Code:
Dim Pcx As New PictureBox 'Create new picturebox ' other stuff Pcx.Image = My.Resources.NS60
vb.net Code:
Dim Cur As Cursor Cur = My.Resources.Cursor0
However, having 'entered' the line, that red 'squiggly' error under-line appears. Hovering the cursor over it I get the message: "Value of type 'System.Drawing.Bitmap' cannot be converted to 'System.Windows.Form.Cursor'."
So I changed it to:
vb.net Code:
Dim Curs As New Cursor = cursor.My.Resources.cursor0
So I tried:
vb.net Code:
Dim Cur As Object Cur = My.Resources.Cursor0
There are loads of examples of how to do something similar, usually with only one or two cursors, and I've not yet found one which specifically allocates them to a control, I've tried each one as I've found it but I'm getting nowhere...
Poppa.
Win.7 Pro. 64bit
8 Gig RAM
Quad core processor.