using visio 11.0 drowing control in visual studio 2005 (C++)

M

Mr

Hi,

I've added to empty form the visio 11.0 drowing control.
I want that the visio toolbars and the menu will appear docked

How do I do that?

Thanks,
Roee
 
J

JuneTheSecond

Visio tool bars cannot be used on the form of Visual Studio 2003 and 2005.
You might built your own toolbars.
But, you can display Visio tool bars on the windows desktop, if the tool
bars are flotaing and enabled. Please note that the dispplayed tool bars
cannot be positioned in the form just floating on the windows desktop. My
example is as shown.
Public Sub FloatingToolBar(ByVal LocalName As String)
Dim cbars As Microsoft.Office.Core.CommandBars
Dim cbar As Microsoft.Office.Core.CommandBar
Dim cbButton As Microsoft.Office.Core.CommandBarButton
Dim cbCombo As Microsoft.Office.Core.CommandBarComboBox
Dim I As Long, N As Long
Dim Space As Long

On Error GoTo ERRHAND
cbars = MyApp.CommandBars
Space = 45
N = cbars.Count
For I = 1 To N
cbar = cbars(I)
Debug.WriteLine(cbar.NameLocal)
If cbar.NameLocal = LocalName Then
cbar.Visible = True
cbar.Position =
Microsoft.Office.Core.MsoBarPosition.msoBarFloating
If cbar.Visible = True And cbar.Enabled = True Then
Select Case (cbar.NameLocal)
Case "Standard"
cbar.Top = 40 + Space
Case "Formatting"
cbar.Top = 40 + Space * 2
Case "Draw"
cbar.Top = 40 + Space * 3
Case "Formatting Text"
cbar.Top = 40 + Space * 4
Case "Formatting ...."
cbar.Top = 40 + Space * 5
Case "Formatting..."
cbar.Top = 40 + Space * 6
Case "Menu Bar" (Menu bar does not appear.)
cbar.Top = 40
Case Else
cbar.Top = 40 + Space * 7
End Select
End If
cbar.Left = 200
Exit For
End If
Next
Exit Sub
ERRHAND:
MsgBox(Err.Description)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top