Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!

in my program i'm adding a controls and that's a tablelayout and I put an event to move it via mouse .. and all of that are easy but the question now (( I'm drawing a line via draw line method and I want to connect this line between two table and I want this line move when I try to move any table who's connect with this line )).

With my best regards.
Posted
Updated 13-Aug-10 13:41pm
v3
Comments
Simon Dufour 13-Aug-10 15:55pm    
The question isn't too clear. I'd like to help you but I don't understand what you need.
Samuel Cherinet 13-Aug-10 16:01pm    
yeah how are you planning to draw the tables in the first place ... if you are using gridviews and adding them as a control to your form then that is one case or are you using graphics to draw the tables as well???
abo_raafat 13-Aug-10 19:39pm    
Sorry because the question wasn't clear ,, I will explain but at first I want to thank everyone who is helping me .. in my program i'm adding a controls and that's a tablelayout and I put an event to move it via mouse .. and all of that are easy but the question now (( I'm drawing a line via draw line method and I want to connect this line between two table and I want this line move when I try to move any table who's connect with this line )).

1 solution

You will probably want to handle your paint event and draw all your objects in there. The classic way to do this, is to have a collection of class instances that represent different objects and their location. When your mouse events mean you need to redraw the form, call Invalidate() to force a paint event. Your code just changes the values of these objects, your paint code simply iterates over the objects and draws them.
 
Share this answer
 
Comments
abo_raafat 14-Aug-10 9:42am    
DO you mean I should make a method that's redraw the line after inalidate() till stop moving the object?

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