Solved

Problem in moving a chess piece

Posted on 2004-09-09
10
201 Views
Last Modified: 2010-05-02
hi all. i am working
i am facingg a basic problem. how do we move pieces from one piece of board to another. i have taken 64 picture boxes to create. now when a player clicks on a picture box say p1 it starts moving with the mouse (Using the mouse move). picture box p1 changes it backcolor to match the picture box on which it is moving. when a user clicks on target picture box the moving picture box p1 is dropped here (after making sure that it is a valid move)

the problem is that when i move a piece, the whole picture box along with its border starts moving which does not look nice. if i had used image control for p1 instead of picture box, then whlie moving it goes back to the another picture box on which it is moving and piece on the image control cant be seen by the user.
any soloution...
i  wish to avoid API as much as possible.
waiting..
Thanks.
0
Comment
Question by:astudent
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
Try not moving your image / picturebox controls around your chess board when you select and drop your piece, instead try set the source and destination pieces image instead..
0
 
LVL 6

Expert Comment

by:mmusante
Comment Utility
You can change the mouse picture to the piece image while dragging ...
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 150 total points
Comment Utility
For each piece of your Chess figures keep an Icon file When Dragging starts from a PictureBox say P1 set the image of that picture box to empty so that the block P1 appears to be empty. Then set the MouseIcon to the Icon corresponding to the Image that was on the block P1. This will give an effect that the Chess Figure is being moved.

However you'll have to use manual dragging otherwise the PictureBox Boundry will alos appear in dragging, even that might not look too bad give it a try

0
 

Expert Comment

by:DextroSoft
Comment Utility
I'm not sure If I understand your question completely....

Do you want to crate an animation of a chess-piece without the drag-drop function the others were talking about ? Are we're talking about a function like this one: MoveCheckpiece(oldposition,newposition)  what will make the animation.

If so..I'm afraid that the built-in graphical capabilities for VB6 or not smooth enough. You better use the api-call "Bitblt"

But first, give more details about what it is exactly what you want so i can figure oit if Bitblt is a solution for you...

Regards,
0
 

Author Comment

by:astudent
Comment Utility
Excellent  arif_eqbal  feedback  !!
but Sir, do you mean that first i need to make 12 icon files (.ico) 6 for black pieces and 6 for white pieces.
waiting..

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:astudent
Comment Utility
... becuase i can use .gif files to set as mouse pointer.
0
 
LVL 19

Expert Comment

by:arif_eqbal
Comment Utility
does not matter if you use .gif files
what I meant was you can have one set of dragging icon say a Grayed piece so that it looks a little different and the same could be used for both Black & White moves and it looks good also....


0
 

Author Comment

by:astudent
Comment Utility
Hello  arif_eqbal  feedback !!
thanks for your reply.
but sir, i think we cant use .gif files as icon files. and i will have to create .ico or .cur files to be used as mouse icon. now i am looking for a software to convert .gif files into .ico or .cur files.
any suggestions  please.
thanks again.
A Student.
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
>>now i am looking for a software to convert .gif files into .ico or .cur files.
Try use microangelo: http://www.microangelo.us
0
 
LVL 6

Expert Comment

by:mmusante
Comment Utility
>>now i am looking for a software to convert .gif files into .ico or .cur
Iconedit Pro is also good ... http://www.iconedit.com/
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now