?
Solved

VB.Net move the button in a form

Posted on 2013-05-30
9
Medium Priority
?
486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

765 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