Jump to content

How to force resize controls (web mode)


KingOrmon

Recommended Posts

Hello,

 

I have 2 images left aligned and client aligned.

When I change left image (with AutoSize to true) I need to resize Main Form or browser to do that these images be aligned correctly.

 

How can I force it via code.

 

Regards

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

KingOrmon,

 

This is not the best way to solve this, but while Mr. Farshad don´t indicate the best solution you can try this to force resize again:

 

procedure TMainForm.UniBitBtn1Click(Sender: TObject);
begin
 UniImage3.Picture.LoadFromFile(GetModulePath(HInstance)+'\SunSet.png');

 Width := Width + 1;
 Width := Width - 1;
end;

 

 

Hello,

 

I attach a simple case, thank you.

 

Steps for reproduce:

 

1. Change image3 via button open

2. You will see that autosize is not triggered. Only when you resize form manually.

Link to comment
Share on other sites

  • Administrators

This may help:

 

procedure TMainForm.UniBitBtn1Click(Sender: TObject);
begin
 UniImage3.Picture.LoadFromFile(GetModulePath(HInstance)+'\SunSet.png');
 UniImage3.Width:=UniImage3.Picture.Width;
 UniImage3.Height:=UniImage3.Picture.Height;
 UniPanel1.ReCalculateAligns;
end;

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...