Hi,
I am using ultraPrintPreviewDialog and UltraGridPrintDocument.I have write the code to print the document.
Now i need to hide the toolbar to restrict the user to print the document.
How to hide the toolbar of ultraPrintPreviewDialog........?
Please help me if any one have any idea about it..................?
The UltraPrintPreviewDialog has a public property named ToolbarsManager that you can access at runtime. You would have to iterate the Tools and disable the tools you want to disable and you can iterate the Toolbars to find the toolbar you want to hide.
Hi Andrew,
I'm using version 8.3 but it seems that this property (ToolbarsManager) isn't public. Is there a way to hide some tools in another way.
Regards
Intellisense was the enemy here is all. The ToolbarsManager property of the UltraPrintPreviewDialog exists and is accessible.
private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e) { switch (e.Tool.Key) { case "Print": HideTools(this.ultraPrintPreviewDialog1.ToolbarsManager); this.ultraPrintPreviewDialog1.ShowDialog(); break; } }
private void HideTools(Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager) { foreach (UltraToolbar toolbar in ultraToolbarsManager.Toolbars) { if (!toolbar.IsMainMenuBar) toolbar.Visible = false; } }
This code leaves me with the File, View, and Tools, menu items of the Main Menu Bar. I could have churned through the tools collections too and hide those but for demonstration I hid all the Toolbars that are not the MainMenuBar (as you can't hide a main menu bar).
The ToolbarsManager sent into the HIdeTools method is just like any other UltraToolbarsManager and will expose the UseOsThemes or any other properties you needed.
I, too, am looking to customize the appearances within UltraPrintPreviewDialog. I'm using 9.1 and can see the ToolbarsManager at runtime, but it's not a public property. Also, there seems to be a missing UseOsThemes property too. Setting the Style or messing with the PreviewSettings and ThumbnailSettings appearances seem to have no effect, similar to UseOsThemes needing to be set false somehow. Is there any sample custom code available? Thanks, Les