Solved

Problem in moving a chess piece

Posted on 2004-09-09
10
204 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 50

Expert Comment

by:Ryan Chong
ID: 12013979
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
ID: 12014384
You can change the mouse picture to the piece image while dragging ...
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 150 total points
ID: 12014999
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Expert Comment

by:DextroSoft
ID: 12016142
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
ID: 12024635
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
 

Author Comment

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

Expert Comment

by:arif_eqbal
ID: 12024846
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
ID: 12033428
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 50

Expert Comment

by:Ryan Chong
ID: 12035241
>>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
ID: 12041540
>>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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

770 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