andyhill Posted January 13, 2018 Share Posted January 13, 2018 With my Mobile Form OnShow Event I want to selectively Hide or Show particular Title Buttons (buttonid 1 in this case), my code below has no effect - please show me how - thanks. for i:= 0 to PDFmForm.TitleButtons.Count - 1 do begin if i = 1 then begin if UniMainModule.PdfEmailFlag = True then begin PDFmForm.TitleButtons.Visible:= True; end else begin PDFmForm.TitleButtons.Visible:= False; end; end; end; Link to comment Share on other sites More sharing options...
Sherzod Posted January 13, 2018 Share Posted January 13, 2018 Hi, Can you use UnimFormCreate instead ? Link to comment Share on other sites More sharing options...
andyhill Posted January 13, 2018 Author Share Posted January 13, 2018 No, Visibility is determined by user action (Form already created with all Title Buttons set to different visibility states). Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2018 Share Posted January 14, 2018 Ok, I will check and let you know Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2018 Share Posted January 14, 2018 Form already created with all Title Buttons set to different visibility states Not MainmForm ? Link to comment Share on other sites More sharing options...
andyhill Posted January 14, 2018 Author Share Posted January 14, 2018 Not Main Form. Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2018 Share Posted January 14, 2018 Ok Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2018 Share Posted January 14, 2018 Can you try this approach for now ?! procedure TUnimForm1.UnimFormShow(Sender: TObject); var I: Byte; begin I := 1; //title "indx" if Self.CloseButton.Visible then Inc(I); //closebutton "indx" //for example, hide TitleButtons[0] UniSession.AddJS(Self.Name + '.titlebar.getAt('+ IntToStr(I) +').hide()'); //or .show() end; Link to comment Share on other sites More sharing options...
Recommended Posts