?
Solved

VB.Net move the button in a form

Posted on 2013-05-30
9
Medium Priority
?
488 Views
Last Modified: 2013-06-14
hi, I am design a restaurant system, now I need a Form to show all the table in the room, and need to move the table to the right position.
I am planing create 50 buttons, set the button visible as QTY request, then change each button's position . but how can I make all the button is movable and remember the position?

I am using Visual studio 2010. VB.net

thanks
0
Comment
Question by:Simon Chen
  • 5
  • 4
9 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39210208
This seemed rather interesting to me, so I created a project for it and put it on ee-stuff.com, hope this is what you wanted: https://filedb.experts-exchange.com/incoming/ee-stuff/8309-EE_Q_28143113.ZIP 

Note that this is far from complete but it has a couple of nice features already like rotate the 'active' table (press space).

For the actual dragging I used some excellent code from another forum (credit in source).
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 39210217
Alternative download link: http://schutt.nl/ee/Q_28143113/EE_Q_28143113.ZIP 

Just for reference, this is how it should look if you press Control-L after running the project:
capture
0
 

Author Comment

by:Simon Chen
ID: 39210822
WOW, you are so amazing!!!
0
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!

 

Author Closing Comment

by:Simon Chen
ID: 39210823
very helpful
0
 

Author Comment

by:Simon Chen
ID: 39210832
but if I need to select a table to place an order, how can I do it then?
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39210922
Glad you liked it!

Well that depends a lot on how it will be used. You could for example make a hidden text field that shows a related remark/order info and set the info visible/fill the text when a table is clicked, for example in the 'MouseUp' event handler. You know which Control was clicked (check the .Text property) so you can relate this to information from an array or database table.

To give more specific help I would need some more info on what else you want to add or are already using.
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39213102
Not sure if that's the way you wanna go but I made a new version with a text box and also fixed some bugs: http://schutt.nl/ee/Q_28143113/EE_Q_28143113_v2.ZIP
0
 

Author Comment

by:Simon Chen
ID: 39248672
Dear Robert

thanks a lot!! I have tested your code and found a strange thing, if at the beginning I have move the button I create ,after I save and load again, it will show this table's name on the textbox, all other I didn't move at all, it won't show the name on the textbox
0
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 39249500
I just tried but can't reproduce the problem. Can you inspect the saved file for problems, or post it? You could try debugging, put a breakpoint in Sub DoLoadPos() for example, does the arrData() array contain the right info?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month14 days, 19 hours left to enroll

840 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