By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

How to draw a line in a form

P: 23
Dear experts,

I have used buttons to indicate certain locations on a map.(Just a picture used as form background)

I am going to draw lines interconnecting these buttons(locations).
But I dont know how to draw lines connecting those buttons.
Can I draw lines using coordinate systems?

Please help me soon to solve this problem.



Anuhas
Jan 29 '08 #1
Share this Question
Share on Google+
8 Replies


P: 41
There is not line control in dot net like VB.one simple option is you can put a label & make the adjustments like Autosize false,Text="||||||||||||" or "--------",make the size to one line visible. You will get a line...

Another option is put the line image...




Dear experts,

I have used buttons to indicate certain locations on a map.(Just a picture used as form background)

I am going to draw lines interconnecting these buttons(locations).
But I dont know how to draw lines connecting those buttons.

Please help me soon to solve this problem.



Anuhas
Jan 29 '08 #2

P: 23
Thank You very much for your advice.
But I need to draw non horizontal lines. Can I draw them using labels?
Other thing is I am using a table lay out panel to locate the buttons(Positions) therefore it is very hard to put labels.

Anuhas
Jan 29 '08 #3

P: 41
You can use border for table layout.

create another column/row to place the label...

for horizontal line put text = "--------"
it will works.. are you creating the control at runtime?

Thank You very much for your advice.
But I need to draw non horizontal lines. Can I draw them using labels?
Other thing is I am using a table lay out panel to locate the buttons(Positions) therefore it is very hard to put labels.

Anuhas
Jan 29 '08 #4

P: 23
I think u have misunderstood.
I need to draw NON horizontal lines.
Please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CLick this URL to see the requirement

http://img212.imageshack.us/img212/2284/figuredx0.jpg
Jan 29 '08 #5

P: 23
Dear experts,

I have used buttons to indicate certain locations on a map.(Just a picture used as form background)

I am going to draw lines interconnecting these buttons(locations).
But I dont know how to draw lines connecting those buttons.

Can I use buttons for this task?
How can I tilt those buttons?

Can I draw lines using coordinate systems?

Please help me soon to solve this problem.



Anuhas
Jan 29 '08 #6

P: 41
ok,You need to use graphics object to draw the graph.

http://www.ondotnet.com/pub/a/dotnet/2002/05/20/drawing.html?page=2

I think u have misunderstood.
I need to draw NON horizontal lines.
Please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CLick this URL to see the requirement

http://img212.imageshack.us/img212/2284/figuredx0.jpg
Jan 29 '08 #7

radcaesar
Expert 100+
P: 759
Try to use Form.Paint Event handler. Get the coordinates of the button and use that coordinate to draw the lines.
Jan 29 '08 #8

P: 23
Dear Experts,

Can I rotate a button? I need a button which is neither horizontal nor vertical. Please help me soon!!!!!!!!!!!

Anuhas
Jan 30 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.