Closed neoxeo closed 8 months ago
@generalloki
Fix doesn't full work.
Change size of picturebox works only if event "Resize" is present.
This code doesn't works :
public Form1()
{
InitializeComponent();
}
private void loadBtn_Click(object sender, EventArgs e)
{
pictureBox1.Size= new SizeD(400, 600);
}
This code works with event Resize for pictureBox1 is present :
public Form1()
{
InitializeComponent();
pictureBox1.Resize += PictureBox1_Resize;
}
private void loadBtn_Click(object sender, EventArgs e)
{
pictureBox1.Size= new SizeD(1,1);
}
private void PictureBox1_Resize(object sender, EventArgs e)
{
pictureBox1.Size= new SizeD(400, 600);
}
It is incorrect to change size in the Resize event. Resize event is fired after size is changed. The problem is in uixml. Please send the full project or at least uixml.
I have checked the project. It doesn't work that way. You need to add some container control like VerticalStackPanel and insert PictureBox and Buttons there.
Ok, thanks.
@generalloki
Test code :
PictureBox not resize