Windows Develop Bookmark and Share   
 index > Windows Forms General > Splitcontainer position relative to Panels
 

Splitcontainer position relative to Panels

I have a point whose position w.r.t Splitcontainer, I would like to get the co-ordinates of the same point w.r.t Panels. And point co-ordinates are going to change depending on the orientation of Splitcontainer.
srinivas_kv80  Monday, November 20, 2006 7:45 AM

How are you getting the point w.r.t SplitContainer? You can convert the client coordinates of one control to the client coordinates of another by using Control.PointToScreen then Control.PointToClient. For example, if you SplitContainer object is named "splitContainer" and your Panel object is named "panel" then you'd perform the conversionlike so:

Point screenPoint = splitContainer.PointToScreen(point);

Point newPoint = panel.PointToClient(screenPoint);

Peter Ritchie  Monday, November 20, 2006 2:45 PM

How are you getting the point w.r.t SplitContainer? You can convert the client coordinates of one control to the client coordinates of another by using Control.PointToScreen then Control.PointToClient. For example, if you SplitContainer object is named "splitContainer" and your Panel object is named "panel" then you'd perform the conversionlike so:

Point screenPoint = splitContainer.PointToScreen(point);

Point newPoint = panel.PointToClient(screenPoint);

Peter Ritchie  Monday, November 20, 2006 2:45 PM

Hi,

does the reply solve your problem? if yes then could you please mark it answered?

thank you,
bhanu.

Bhanu Prakash Nunna - MSFT  Monday, November 20, 2006 9:30 PM

You can use google to search for other answers

Custom Search

More Threads

• Check if TextBox contents are Numeric
• WebBrowser print properties
• Restricting window button from wrapping its text/caption
• UIPAB v2.0 example
• DataGrid with excel functions
• Compass Navigational Calculations in Excel
• Compiling Multiple Projects - Best Approach?
• Treeview Tutorial
• TextBox background color issue on transparent GroupBox
• Moving images fluently