Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Problem in moving a chess piece

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
astudent
Asked:
astudent
  • 3
  • 2
  • 2
  • +2
1 Solution
 
Ryan ChongCommented:
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
 
mmusanteCommented:
You can change the mouse picture to the piece image while dragging ...
0
 
arif_eqbalCommented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DextroSoftCommented:
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
 
astudentAuthor Commented:
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
 
astudentAuthor Commented:
... becuase i can use .gif files to set as mouse pointer.
0
 
arif_eqbalCommented:
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
 
astudentAuthor Commented:
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
 
Ryan ChongCommented:
>>now i am looking for a software to convert .gif files into .ico or .cur files.
Try use microangelo: http://www.microangelo.us
0
 
mmusanteCommented:
>>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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now