views:

72

answers:

1

Hi, I'm inserting a custom winform control in a WPF/ XAML window, however i'm realising that the sizing seems to be very different, what i designed in winform to be 730pixels wide for instance, when placed via a WindowsFormsHost, in a container 730pixels (or at least i think they're pixels..) wide, the control looks much larger and doesnt fit in the host and results in clipping from the right and bottom.

Would anyone know how to make these sizes match or something? I'm really at a loss and its very difficult to fix a custom control to make it look as it should off hand on WPF! Please help!

+2  A: 

WPF sizes are not in pixels, they are in units of 1/96 inch. Your video adapter is probably set to 120 DPI, you'd have to make it 730 / 96 * 120 = 913 units wide.

Hans Passant
THanks, what i finally did was put away with the winform cause they dont seem to be too compatible.
Erika