Hi, I'm developing an app that is a mix of WPF and Forms. Some Forms are hosted in wpf host some in form host . What I want to do is to make my app scalable on resize. When user expand the form it should stay in the center when windows gets smaller it should scale with it. I did something like this
protected override void OnResize(EventArgs e)
{
//m_importWizardControl.ScaleValue = 0.5;
var scalex = this.Width / m_importWizardControl.Width;
var scaley = this.Height / m_importWizardControl.Height;
//if (scalex < 1 || scaley < 1)
//{
m_scale.ScaleX = scalex;
m_scale.ScaleY = scaley;
//}
m_importWizardControl.LayoutTransform = m_scale;
base.OnResize(e);
}
then when i lunched the app "x encourage a problem and needs to be closed". is there any other way around? m_importWizardControl is a WPF Usercontrol and this code is in MainForm.