Topic: File menu
I would like to disable "Settings" and "About" in the file menu before distributing an application to the end user.
Very unusual not being able to customize the file menu.
My Visual Database → General → File menu
I would like to disable "Settings" and "About" in the file menu before distributing an application to the end user.
Very unusual not being able to customize the file menu.
Thanks !
Hello Roger
If you want hide original menus to replace them with your own menus, I can send you my own script to do that
JB
Yes please. I have sent you a mail.
Hello Roger
Please find in attachment my zipped menus
Sorry, words are in French, but you will adapt them without difficulty according to your needs.
If any question, no hesitation, send me a message on forum.
If any problem, I can translate french terms if this can help you.
JB
Perfect !
Thanks a lot.
I have used a script for disabling the file menu in one form, but when I added another form trying the same it failed.
procedure Fleverandorkontakt_OnShow (Sender: string; Action: string);
begin
Fleverandorkontakt.mniAbout.Visible := False;
Fleverandorkontakt.mniOptions.Visible := False;
Fleverandorkontakt.TableGrid1.BestFitColumns(bfBoth);
end;
procedure Fkontraktsansvarlig_OnShow (Sender: string; Action: string);
begin
Fkontraktsansvarlig.mniAbout.Visible := False;
Fkontraktsansvarlig.mniOptions.Visible := False;
Fkontraktsansvarlig.TableGrid1.BestFitColumns(bfBoth);
//Fkontraktsansvarlig.TableGrid1.Visible := False;
end;
SCRIPT ERROR MESSAGE: Undeclared indentifier:'mniAbout'
When I commented the lines out the application triggered a message for the procedure itself.
Obviously some variable declaration missing, but how do I fix it ?
roger
Menu present only on Main form, do you have menu on another form?
Hi Roger,
You only need to disable the file menu options once, on the first form that is called when you run your application. So, your script would typically read as follows:
procedure Form1_OnShow (Sender: string; Action: string);
begin
form1.mniAbout.Visible := False;
form1.mniOptions.Visible := False;
form1.mniFile.Visible := False;
end;
The menu options on Form1 and any other form are now all removed.
Hope this helps,
Derek
OK, but when I remove the procedure for the second form the application goes bananas complaining about missing identifier for the next (previously working procedure).
roger
Please attach your project (zip file without exe and dll)
Enclosed, but now I have cleaned up other code in order to try fixing the problem. I just got worse.
Enclosed, but now I have cleaned up other code in order to try fixing the problem. I just got worse.
I don't get any error messages in your project, how to reproduce the error?
Just RUN and the message comes up.
I see that you commented this line (attached project without commented this line):
//sHello: string;
You should to comment and this line (first line in your code), because after keyword var variables must be declared:
var
That doesn't change the problem. See screen cut.
In your attached project there is no this code, please attach actual your project.
OK
Hi Roger,
I think the problem could simply be the sequence in which your forms are held.
I downloaded your project and encountered the same problem as you.
When I switched the sequence of the forms, the error is corrected (see roger.jpg).
Maybe this helps.
Derek
You are right, but should it be like this ?
The fixed project.
Trying to use the menuline for shifting between forms, but I can't get it right.
Trying to use the menuline for shifting between forms, but I can't get it right.
Check out this example, how to create mainmenu on other form
http://myvisualdatabase.com/forum/misc. … download=1
The example does not show swapping forms using a file menu.
Form1 shows Form2 by the use of a button.
My goal was having the same file menu on all forms in order to swap between them.
If you plan using only buttons with standard actions like "New Record, Show Record, Show Form", you can't freely switching between forms, because using modal forms (https://en.wikipedia.org/wiki/Modal_window)
You can switching between forms if you will use script to shows forms, like:
Form2.Show;
My Visual Database → General → File menu
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi