Marco Hsu Posted October 21, 2020 Share Posted October 21, 2020 I want to set UnimSegmentedButton's Image above the text,like the second image. Tks! Link to comment Share on other sites More sharing options...
Sherzod Posted October 21, 2020 Share Posted October 21, 2020 49 minutes ago, Marco Hsu said: I want to set UnimSegmentedButton's Image above the text,like the second image. Tks! Hello, One possible solution: procedure TMainmForm.UniFormCreate(Sender: TObject); begin UnimSegmentedButton1.JSInterface.JSAddListener( 'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top")})}' ); end; Link to comment Share on other sites More sharing options...
Marco Hsu Posted October 21, 2020 Author Share Posted October 21, 2020 1 hour ago, Sherzod said: Hello, One possible solution: procedure TMainmForm.UniFormCreate(Sender: TObject); begin UnimSegmentedButton1.JSInterface.JSAddListener( 'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top")})}' ); end; Thank you,but I have a small question: I cannot set the Image's Height and Wight.The Image is very small when the form is showing. Link to comment Share on other sites More sharing options...
Sherzod Posted October 21, 2020 Share Posted October 21, 2020 Can you make a simple testcase to check? Link to comment Share on other sites More sharing options...
Marco Hsu Posted October 21, 2020 Author Share Posted October 21, 2020 2 minutes ago, Sherzod said: Can you make a simple testcase to check? Ok kaoqinyi.rar Link to comment Share on other sites More sharing options...
Sherzod Posted October 22, 2020 Share Posted October 22, 2020 19 hours ago, Marco Hsu said: kaoqinyi.rar 5.67 MB · 5 downloads Hello, Try this: sgbtn1.JSInterface.JSAddListener( 'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top"); button.iconElement.setStyle("width", "64px"); button.iconElement.setStyle("height", "64px");})}' ); Link to comment Share on other sites More sharing options...
Marco Hsu Posted October 22, 2020 Author Share Posted October 22, 2020 2 hours ago, Sherzod said: Hello, Try this: sgbtn1.JSInterface.JSAddListener( 'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top"); button.iconElement.setStyle("width", "64px"); button.iconElement.setStyle("height", "64px");})}' ); OK,Tks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts