Hello All,
I have a windows form called Form1. There is a button1 on Form1, which opens another form in PlotTool, which is a WPF form.
private void button1_Click(object sender, EventArgs e)
{
var window = new System.Windows.Window();
var userControl = new PlotTool.UserControl1();
window.Content = userControl;
window.Show();
}
Clicking the button1 changes the resolution and size of the Windows Form1. It can be seen, as in attached picture, that the size of the windows Form1 decreases than original size and it also looks like its resolution has changed. I have tried controlling DPI on forms, but was not helpful.
Why is this happening and how can this be avoided? Hope you can help with this.
I am working in Visual Studio Community 2017 in Windows 10
I have .NET framework 4.6.1
Attached is code for reference.
Thank you.