Jump to content

Mobile Form TitleButtons selectively Hide / Show - How ?


andyhill

Recommended Posts

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

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

×
×
  • Create New...