How to hide the drawing page frame in the drawing window

S

Sergey Zamansky

Hi,
My application draws using Visio 2003 ActiveX drawing control. The drawing
is stored in database and is printed very occasionally so I do not need the
drawing page frame with shadow in the drawing window. What is a way to hide
the drawing page frame in the drawing window and draw just on the window?
By the way I can not hide page shadow in Visio using Shadows dialog in
File-Page Setup menu: the page shadow appears in any case.

Thank you in advance,
Sergey
 
C

Chris Roth [ Visio MVP ]

Sergey,

Here's some ideas:

Try putting a Visio control on a form, then play with the sample code below.
You might want to set the Anchor properties of the Visio control to your
liking.

The code makes the Visio page always the same as the drawing control. You
might not want that behavior, but perhaps it will give you some ideas. The
scrollbars and grid and rulers all go away, too, which makes everything
cleaner. However, the user can still scroll the window with
Ctrl+Shift+Right-mouse drag, or with a roller wheel.

Also, try controlling the view of Visio within the control (and perhaps the
size of the Visio control) You can use window.GetViewRect, and
window.GetWindowRect, plus the 'Set' versions of these methods to map
between Visio drawing coordinates and window coordinates, and to control pan
& zoom.

That way you can force the Visio window to always display the whole page,
regardless of what the user does, or how the window sizes.


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

' Visio page resizes to fit window:

Me.AxDrawingControl1.PageSizingBehavior =
Microsoft.Office.Interop.Visio.VisPageSizingBehaviors.visResizePages

' Turn off other window junk:

Me.AxDrawingControl1.Document.Application.ActiveWindow.ShowGrid = False

Me.AxDrawingControl1.Document.Application.ActiveWindow.ShowRulers = False

Me.AxDrawingControl1.Document.Application.ActiveWindow.ShowScrollBars =
False

Me.AxDrawingControl1.Document.Application.ActiveWindow.ShowPageTabs = False

' See also:

'visWindow.GetViewRect

'visWindow.GetWindowRect

'visWindow.SetViewRect

'visWindow.SetWindowRect

End Sub








--

Hope this helps,

Chris Roth
Visio MVP
 

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