Click here to Skip to main content
15,066,326 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi i want to move my TextBoxs on runtime in c# and with this i have no problem but i want when i moving a TextBox it show me a line for set with another TextBoxs and the form (just set with TextBoxes not other controls) like C# in designer when you move a control it show you a line and you can set it with another controls and form
With Respect
Posted
Updated 22-Feb-15 11:03am
v2
Comments
Afzaal Ahmad Zeeshan 22-Feb-15 15:09pm
   
This is way too off-topic. What have you tried until now?
Avenger1 22-Feb-15 15:19pm
   
set TextBox like C# designer with other TextBoxes and form
Sergey Alexandrovich Kryukov 22-Feb-15 17:05pm
   
Why? And how moving can be a problem?
—SA
Kuthuparakkal 22-Feb-15 16:23pm
   
I dont understand, can you make it clear ?
Sergey Alexandrovich Kryukov 22-Feb-15 17:04pm
   
You did not even specify what do you mean by "TextBox". How about its full type name?
—SA
Gideon van Dyk 22-Feb-15 21:22pm
   
From what I can ascertain, you are looking for a run time equivalent functionality to be able to dynamically move objects on your UI around with the included "guidelines" you get when in Design mode? This is not something that's easily just done, you will need to introduce some UI monitoring.
Avenger1 23-Feb-15 1:53am
   
when you move a control in your C# design UI, you can set it position with other controls i want to know how to do it in my program

1 solution

One way I thought would be to keep a list of other controls/textboxes and each time you drag the other TextBox keep track of there X and Y coordinates. Have a panel or other custom control on layer below where the form is being designed. Each time re-draw the 'guide' lines on the panel if the X Y coordinates line up.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900