Solved

VB.Net move the button in a form

Posted on 2013-05-30
9
478 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 500 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
 

Author Closing Comment

by:Simon Chen
ID: 39210823
very helpful
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 40
DataGridview Currency Formating? 22 53
Round up to 100% in .NET 10 85
I need help converting a bitmap to an image in VB.Net 1 14
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

13 Experts available now in Live!

Get 1:1 Help Now