![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
![]()
HOW-TO implement in VB : show/hide ALL toolbars (as AI)
|
#2
|
||||
|
||||
![]() Quote:
Assign a shortcut key to ShowHideToolbars and you are all set. Note that there is no way to show/hide dockers through automation... unfortunately... Code:
Option Explicit Private Sub HideToolbars() Dim cmdbar As CommandBar Dim bars() As String Dim n As Long, nCount As Long Dim nSavedCount As Long nCount = CommandBars.Count nSavedCount = 0 ReDim bars(0 To nCount - 1) For n = 1 To nCount Set cmdbar = CommandBars(n) If cmdbar.Name <> "Menu Bar" And cmdbar.Name <> "Status Bar" And cmdbar.Name <> "Toolbox" Then If cmdbar.Visible Then cmdbar.Visible = False ' Save the name of the toolbar so we can restore its visibility later bars(nSavedCount) = cmdbar.Name nSavedCount = nSavedCount + 1 End If End If Next n ReDim Preserve bars(0 To nSavedCount - 1) SaveSetting "ShowHideToolbars", "ToolbarState", "Toolbars", Join(bars, ":") End Sub Private Sub RestoreToolbars(ByVal strSavedBars As String) Dim cbar As Variant For Each cbar In Split(strSavedBars, ":") CommandBars(cbar).Visible = True Next cbar ' Erase the previous state... SaveSetting "ShowHideToolbars", "ToolbarState", "Toolbars", "" End Sub Sub ShowHideToolbars() Dim strSavedBars As String strSavedBars = GetSetting("ShowHideToolbars", "ToolbarState", "Toolbars") If strSavedBars <> "" Then RestoreToolbars strSavedBars Else HideToolbars End If End Sub Last edited by Alex; 23-06-2005 at 12:13. |
#3
|
||||
|
||||
![]()
cool code,
thnx a lot |
#4
|
||||
|
||||
![]()
I tried to hide scrollbars by findwinow / showwindow and corel always recalculates MDI frame size and leaves 12 pixels unused though scrollbars are not shown... ;-( I want to extend "ShowHide toolbars" to hide scrollbars also. (I tried also window inspectors, so it's not code problem)
help please, Alex, it would be a great feature indeed! |
#5
|
||||
|
||||
![]()
I don't think you can do what you want. Just hiding scrollbar "window" won't make the rest of window content to take its place. When the document expects to have scrollbars and explicitly creates/shows them, it is not responsible for your actions to actually go and hide them.
![]() |
#6
|
|||
|
|||
![]()
what is / <> ""/
i always receive an error on this |
#7
|
||||
|
||||
![]() Quote:
|
#8
|
||||
|
||||
![]() ![]() • ShowHideToolbars - toggles visibility of UI elements such as toolbars, palettes, menu, rulers, guides, dockers (undocked) • SetupShowHideToolbars - shows options dialog where you can setup what UI elements will be toggled Download: http://recentfiles.netfirms.com/#wx_ToggleToolBars Emergency restoring of menu visibility if you cannot relaunch the macro using keyboard shortcut: 1. press and hold Alt key (all the time to last step) 2. rightclick empty space in document window 3. in menu that appeared, rightclick any item 4. enable "Menu" (usual leftclick) 5. release Alt ![]() Last edited by wOxxOm; 26-02-2008 at 21:59. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to implement CorelDraw macro's in Designer | Bellekom | Macros/Add-ons | 3 | 11-05-2005 12:32 |
How to implement Ctrl & alt keys in code | xombie | CorelDRAW/Corel DESIGNER VBA | 2 | 08-01-2005 13:17 |
format text dialog box implement | graphicdesigner | CorelDRAW/Corel DESIGNER VBA | 5 | 22-12-2004 14:37 |
closing dockers/interactive toolbars to speed up a macro | Rick Randall | CorelDRAW CS | 1 | 09-12-2002 21:39 |