Resize Shape Window

D

dinesh

Hi

how can we resize the shape window (i.e stencil window) when displaying it
in bottom in C#

thnaks

Dinesh
 
J

JuneTheSecond

I forgot to paste my test code. Sorry.

Sub ChangeHeight(NewHeight As Long)
Dim mywin As Visio.Window
Dim nLeft As Long, nTop As Long, nWidth As Long, nHeight As Long
On Error GoTo ERRMSG

Set mywin = ActiveWindow.Windows.ItemFromID(1669)
mywin.GetWindowRect nLeft, nTop, nWidth, nHeight
mywin.WindowState = visWSFloating
nHeight = NewHeight
mywin.SetWindowRect nLeft, nTop, nWidth, nHeight
mywin.WindowState = visWSDockedBottom
Exit Sub
ERRMSG:
MsgBox Err.Description
End Sub
 
D

dinesh

hi

thanks for the reply.but it's seem the height of the shapes window dosen't
chnage. can any tell me how to restrict the number of rows in the sahape
window to 2 when the shape window is docked bottom.

dinesh
 
D

David Parker

I don't think that this is as easy as you might have thought.
The shape window may or may not be merged with other windows.
The shape window may or may not be autohide.
JuneII's code works perfectly well if there are no other windows already
docked at the bottom:
All you need is to call it with something like:

Sub MakeShapesWindowThirdOfHeight()
Dim lL As Long, lT As Long, lW As Long, lH As Long
Visio.ActiveWindow.GetWindowRect lL, lT, lW, lH
ChangeHeight CLng(lH / 2)

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