473,382 Members | 1,348 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,382 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 4588
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,...
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
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.