andyhill Posted February 7, 2018 Share Posted February 7, 2018 I have a Mobile Form (MymForm) that has several Title Buttons. I want to change the Caption of TitleButtons[0] on the Form Show Event - please advise how - thanks. procedure TMymForm.UnimFormShow(Sender: TObject); begin if UniMainModule.tblData.Filtered = True then begin MymForm.TitleButtons[0].Caption:= 'ABC'; end else begin MymForm.TitleButtons[0].Caption:= 'DEF'; end; The code above executes without error but makes no difference to the Caption and the original IDE Caption setting remains. Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2018 Share Posted February 8, 2018 Hi, Can you try this approach for now ?: For example: procedure TUnimForm1.UnimFormShow(Sender: TObject); var I: Byte; begin I := 0; if Self.CloseButton.Visible then Inc(I); //closebutton "indx" Self.TitleButtons[0].Caption := 'New Title'; UniSession.AddJS(Self.Name + '.titlebar.getAt('+ IntToStr(I) +').setText("New Title")'); end; Best regards, Link to comment Share on other sites More sharing options...
andyhill Posted February 8, 2018 Author Share Posted February 8, 2018 Thank you. My CloseButton = 1 so I actually had to make my TitleButton = 2 to work (it appears to be 1 based [not zero based]). Link to comment Share on other sites More sharing options...
Sherzod Posted February 8, 2018 Share Posted February 8, 2018 Yes like in this post: http://forums.unigui.com/index.php?/topic/9842-mobile-form-titlebuttons-selectively-hide-show-how/&do=findComment&comment=51179 I tested it on ExtJS 6 Link to comment Share on other sites More sharing options...
Recommended Posts