Suppressing Infopath Toolbars - InfoPath Dev
in

InfoPath Dev

Suppressing Infopath Toolbars

Last post 10-06-2005 11:19 AM by Patrick Halstead. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-03-2005 09:41 PM

    • qwer
    • Top 500 Contributor
    • Joined on 10-04-2005
    • Posts 49

    Suppressing Infopath Toolbars

    Is there a way to suppress the standard infopath menu & toolbars (eg, file/edit/view menu, standard and formatting toolbars)? I want the user to basically only see the form appearing with no toolbars, just like a web page viewed in full screen. Can anyone help me out please?
  • 10-04-2005 02:04 AM In reply to

    Re: Suppressing Infopath Toolbars

    Hi,

    Yes you can. I am assuming that you will use C# behind your form.

    Call from OnLoad:
    public void OnLoad(DocReturnEvent e)
    {EnableToolBars(false);}

    private void EnableToolBars(bool enableToolbar)
    {
    ObjectWrapper commandBars = (ObjectWrapper) thisApplication.ActiveWindow.CommandBars;
    EnableBar(enableToolbar, "Menu Bar", commandBars);
    EnableBar(enableToolbar, "Standard", commandBars);
    }
    private void EnableBar(bool enableToolbar, string barName, ObjectWrapper commandBars)
    {
    BindingFlags flags = BindingFlags.GetProperty | BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance;
    object[] args = new object[] {barName};
    CommandBar commandBar = (CommandBar) commandBars.InvokeByName(
    "Item",
    flags,
    args, // arguments
    null); // Culture
    commandBar.Enabled = enableToolbar;
    }

    Hope that it helps.

    Regards,

    Franck Dauché
  • 10-04-2005 05:15 PM In reply to

    • qwer
    • Top 500 Contributor
    • Joined on 10-04-2005
    • Posts 49

    Re: Suppressing Infopath Toolbars

    thanks franck

    can this be done in vbscipt?

    i am half way through designing a form and i started it using vbscript. I thought that you could only use jscript or vbscript behind the form? how do you go about attaching c# script (while having vbscript)?
  • 10-04-2005 05:45 PM In reply to

    Re: Suppressing Infopath Toolbars

    Hi,

    Unfortunately, you won't be able to mix vbscript with C#. When you first started your design, using Visual Studio.Net would throw you into Managed Code (C# or VB.Net). The route you took was to design a form through IP, which then supports vbscript or jscript.

    Sorry, I don't have any scripting to do this.

    Franck Dauché
  • 10-06-2005 11:19 AM In reply to

    Re: Suppressing Infopath Toolbars

    Hi Qwer and welcome to our forum!
    How much code do you have? I agree with Franck that converting to managed code is a good idea. VB.NET should do the trick.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.