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

Trouble Creating Custom Mouse Pointer in Board Game...

I am building a chess game application that allows a user
to click on a piece and move it to a new square. When the
user clicks on a piece the mouse pointer must change to
the image associated with that square. The squares are
PictureBoxes with images of the pieces set to the pBox's
image property.

I am having trouble with changing the mouse pointer to a
custom mouse pointer during drag and drop operations. I
have checked several articles on Google for a solution.
One article I found stated that a custom Cursor object
must be created and placed in a resource file -- then at
runtime the custom cursor can be assigned to the pBox's
cursor property.

This is a common feature of board games where images are
moved about to show a player's move. If anyone out there
has done this in Visual Basic .Net, please share your
profound knowledge so that I may complete this area of my
application.

Thanks in advance,
Tom Alcendor
ta*******@netscape.net

Jul 21 '05 #1
2 4589
I don't have code, but I believe you can achieve this through the
CreateIconIndirect API call.

"Tom Alcendor" <ta*******@netscape.net> wrote in message
news:43****************************@phx.gbl...
I am building a chess game application that allows a user
to click on a piece and move it to a new square. When the
user clicks on a piece the mouse pointer must change to
the image associated with that square. The squares are
PictureBoxes with images of the pieces set to the pBox's
image property.

I am having trouble with changing the mouse pointer to a
custom mouse pointer during drag and drop operations. I
have checked several articles on Google for a solution.
One article I found stated that a custom Cursor object
must be created and placed in a resource file -- then at
runtime the custom cursor can be assigned to the pBox's
cursor property.

This is a common feature of board games where images are
moved about to show a player's move. If anyone out there
has done this in Visual Basic .Net, please share your
profound knowledge so that I may complete this area of my
application.

Thanks in advance,
Tom Alcendor
ta*******@netscape.net

Jul 21 '05 #2
In fact scrub that. you just need

Me.Cursor = New Cursor(MyBitmap.GetHicon)

"Mick Doherty" <md*******@nospam.ntlworld.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I don't have code, but I believe you can achieve this through the
CreateIconIndirect API call.

"Tom Alcendor" <ta*******@netscape.net> wrote in message
news:43****************************@phx.gbl...
I am building a chess game application that allows a user
to click on a piece and move it to a new square. When the
user clicks on a piece the mouse pointer must change to
the image associated with that square. The squares are
PictureBoxes with images of the pieces set to the pBox's
image property.

I am having trouble with changing the mouse pointer to a
custom mouse pointer during drag and drop operations. I
have checked several articles on Google for a solution.
One article I found stated that a custom Cursor object
must be created and placed in a resource file -- then at
runtime the custom cursor can be assigned to the pBox's
cursor property.

This is a common feature of board games where images are
moved about to show a player's move. If anyone out there
has done this in Visual Basic .Net, please share your
profound knowledge so that I may complete this area of my
application.

Thanks in advance,
Tom Alcendor
ta*******@netscape.net


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jason | last post by:
Hi, I wish to create a little game where you drag pieces onto a board. I have been playing around with a picture box: Private Sub Picture1_DblClick() Picture1.Left = Picture1.Left + 50 End...
4
by: Gonzalo Aguirre | last post by:
i have a classes diagram like this ------------ * ---------- | Vehicles | ------------------------- | Parking| ------------ vehicles ---------- ^ |...
2
by: ck388 | last post by:
I was wondering if anyone could answer a couple of questions regarding developing games. I would like to create one for fun on my spare time. I want to know what type of technologies I would have...
2
by: Tom Alcendor | last post by:
I am building a chess game application that allows a user to click on a piece and move it to a new square. When the user clicks on a piece the mouse pointer must change to the image associated...
2
by: apec | last post by:
Dear All, I'm having trouble getting my c++ code to work (below). Any suggestions as to what could be the problem? I think it has to do with the while loop, since the program ends before command...
31
by: JoeC | last post by:
I have read books and have ideas on how to create objects. I often create my own projects and programs. They end up getting pretty complex and long. I often use objects in my programs they are...
10
by: sam_cit | last post by:
Hi Everyone, I'm working on developing a chess game and i decided to use c++ for its object oriented approach. I have a bass class unit and is inherited to distinct number of units (like king,...
1
by: enp | last post by:
Hello, I am trying to create a board game in C#. I have looked into several different websites for creating a board for my game but I am unsuccessful. can somebody help me with their suggestion...
5
kadghar
by: kadghar | last post by:
Most of the times VBA is used with variables. Objects (such as worksheets, cells or databases) are only used when we read their properties (value, formula, font...) or we use a method (save,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.