KingOrmon Posted June 29, 2012 Share Posted June 29, 2012 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 More sharing options...
KingOrmon Posted July 11, 2012 Author Share Posted July 11, 2012 any idea ? Link to comment Share on other sites More sharing options...
dieger Posted July 11, 2012 Share Posted July 11, 2012 any idea ? Try, Self.FormRegion.ReCalculateAligns; Link to comment Share on other sites More sharing options...
KingOrmon Posted July 11, 2012 Author Share Posted July 11, 2012 Sorry, but ReCalculateAligns where is declarated ? Link to comment Share on other sites More sharing options...
dieger Posted July 11, 2012 Share Posted July 11, 2012 Sorry, but ReCalculateAligns where is declarated ? Sorry KingOrmon, I have copied a code from a frame. Try it on MainForm for example: Self.WebForm.ReCalculateAligns; Regards. Link to comment Share on other sites More sharing options...
KingOrmon Posted July 11, 2012 Author Share Posted July 11, 2012 Sorry, but it does not work. It only resizes when I manually resize browser then all images are autosized and well aligned. Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 21, 2012 Administrators Share Posted July 21, 2012 Send a simple test case please. Link to comment Share on other sites More sharing options...
KingOrmon Posted July 22, 2012 Author Share Posted July 22, 2012 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. UniGui1.rar Link to comment Share on other sites More sharing options...
dieger Posted July 23, 2012 Share Posted July 23, 2012 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 More sharing options...
Administrators Farshad Mohajeri Posted July 23, 2012 Administrators Share Posted July 23, 2012 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 More sharing options...
KingOrmon Posted July 24, 2012 Author Share Posted July 24, 2012 Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now