PC Review


Reply
Thread Tools Rate Thread

To draw line across panel controls.

 
 
chittorian
Guest
Posts: n/a
 
      21st Oct 2008
I am trying to draw lines between buttons inside two different wrap panel
..This has to happen on click of button .The partial code goes below.
UserControlButton btn = (UserControlButton)sender;
WrapPanel parentPanel = VisualTreeHelper.GetParent(btn) as WrapPanel;
Point position = Mouse.GetPosition(parentPanel);
Point startPosition = new Point();
Point endPosition = btn.PointToScreen(position);
startPosition.X = endPosition.X - position.X;
startPosition.Y = endPosition.Y;
Line line = DrawLine(endPosition, startPosition, Brushes.Red);

The first problem is Mouse.GetPosition(parentPanel); it is not returning
posistion with respect to wrap panel.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: draw line on a form/panel and remove/clear the line? rowe_newsgroups Microsoft VB .NET 0 18th Jan 2007 02:51 AM
Re: draw line on a form/panel and remove/clear the line? Ray Cassick Microsoft VB .NET 0 18th Jan 2007 12:10 AM
How to draw line on Panel? =?Utf-8?B?U2FudG9zaA==?= Microsoft Dot NET Compact Framework 1 13th Jul 2006 11:19 AM
Draw a Line in a Panel Control? Roger Odermatt Microsoft Dot NET Compact Framework 1 19th Jan 2006 12:34 PM
HOW TO Make a Draw Line Controls (Can Resize and Dele etc) smilnet Microsoft C# .NET 1 8th Nov 2004 12:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.