Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

is it possible to hide the toolbar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrej - 23 Dec 2005 10:05 GMT
hi,

is it possible to hide the tollbar? so if a user opens the form he see just
the form and no menues or buttons in the top of it.

thanks
Franck Dauché - 23 Dec 2005 19:50 GMT
Hi,

Yes you can hide toolbars. 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é

> hi,
>
> is it possible to hide the tollbar? so if a user opens the form he see just
> the form and no menues or buttons in the top of it.
>
> thanks
robot smiff - 23 Jan 2006 16:49 GMT
Thanks for the code...  Where do I put it?

JK

> Hi,
>
[quoted text clipped - 38 lines]
> >
> > thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.