1 (edited by v_pozidis 2020-12-13 10:10:49)

Topic: Menu show and DatetimePicker

Hi all, in my program I have hide the menu from the form1 (start form). I want a script  that shows the menu again if there is no user as an admin
and my second question is how can I add 30 minutes in a dateTimePicker using script  (kind as Time)


Thank you

2 (edited by derek 2020-12-13 13:18:54)

Re: Menu show and DatetimePicker

Hi Vpozidis,
You could try it something like this:
procedure Form1_OnShow (Sender: TObject; Action: string);
begin
  if application.user.is_admin= true then form1.borderstyle := bssingle else form1.borderstyle := bsdialog;
end;
Derek.

Re: Menu show and DatetimePicker

Hi Again,
Sorry, forgot about the second part of your question - try adding 30 minutes (or however long) like this (see attached).  I don't know of any other way but some of the other Forum members may have some ideas.
The passwords are the same as the userIDs.
Derek.

Post's attachments

Attachment icon vpozidis.zip 336.61 kb, 237 downloads since 2020-12-13 

Re: Menu show and DatetimePicker

derek that's great. thank you...
and because my mat is not so good how can we do the opposite
Thank you in advance

Re: Menu show and DatetimePicker

I did mine differently to Derek's,


         Form1.DateTimePicker1.DateTime := (Time + 1);

The above adds 1 hour to the DateTimePicker from the current PC system time.


I haven't tried adding minutes instead of hours, and, it might not be possible using the Time function.

On a clear disk you can seek forever