User located controls
-
Can anyone give me (rookie C# programmer) an idea how to use standard controls that can be dragged to a new location by the user during program execution. I would like to use various controls (TextBox, Button) to graphically represent a continuous beam (structural engineering) containing the member information (length, moment of intertia, cross sectional area, joint details, loads, etc). Thanks in advance
Ron Modesitt
-
Can anyone give me (rookie C# programmer) an idea how to use standard controls that can be dragged to a new location by the user during program execution. I would like to use various controls (TextBox, Button) to graphically represent a continuous beam (structural engineering) containing the member information (length, moment of intertia, cross sectional area, joint details, loads, etc). Thanks in advance
Ron Modesitt
This is probably not a rookie task ;) Just as a starting point I would begin by monitoring the Mouse Button Click events as follows: In the Mouse Button Down event I would record the coordinates of the mouse pointer and the control being clicked. Then in the button Up event I would check the coordinates of the mouse again. If the delta between the starting and new locations are greater than, say, the size of the control oringall clicked (or some other specific value) then set the Location property of the control to the new coordinates. This approach will not create the dragging effect visually but it should move the controls for you. Good Luck.
-
This is probably not a rookie task ;) Just as a starting point I would begin by monitoring the Mouse Button Click events as follows: In the Mouse Button Down event I would record the coordinates of the mouse pointer and the control being clicked. Then in the button Up event I would check the coordinates of the mouse again. If the delta between the starting and new locations are greater than, say, the size of the control oringall clicked (or some other specific value) then set the Location property of the control to the new coordinates. This approach will not create the dragging effect visually but it should move the controls for you. Good Luck.
Many thanks. I agree this is not a rookie task, however, your suggestion is a good idea and one that this rookie understands.
Ron Modesitt