Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ControlHost size (Read 1635 times)
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
ControlHost size
Jul 16th, 2007 at 5:08am
Print Post  
I've got a UserControl DataSetSelection that I am trying to host in a flowchart on a ControlHost.

The problem I am having is that I can't seem to get the control host size to match the control size. From searching the forums I have found that the control host expects milimeters, but the example code I thought may work, still delivers a huge control (or perhaps drop shadow), that doesn't match my control in size

Code
Select All
            DataSetSelection dss =new DataSetSelection(program, pres_layer);
            ptBase = chart.PointToClient(new Point(dss.Width, dss.Height));
            ControlHost chsPhysical = chart.CreateControlHost(10, 10, ptBase.X, ptBase.Y );
 



I would appreciate any assistance

Cheers
JC
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlHost size
Reply #1 - Jul 16th, 2007 at 6:19am
Print Post  
Use the ClientToDoc(Rectangle) method to convert from pixels to logical coordinates. Also set ControlPadding and subtract twice its value from the rectangle width and height. Do not use the default ControlPadding value, because it is -1.

Stoyan

  
Back to top
 
IP Logged
 
pelion
Junior Member
**
Offline



Posts: 61
Joined: Nov 12th, 2006
Re: ControlHost size
Reply #2 - Jul 16th, 2007 at 8:50pm
Print Post  
Thanks again Stoyo,
perfect
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint