开发者

Winform custom control in WPF

开发者 https://www.devze.com 2022-12-25 13:34 出处:网络
I\'m inserting a custom winform control in a WPF/ XAML window, however i\'m realising that the sizing seems to be very d开发者_如何学运维ifferent, what i designed in winform to be 730pixels wide for i

I'm inserting a custom winform control in a WPF/ XAML window, however i'm realising that the sizing seems to be very d开发者_如何学运维ifferent, 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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号