Where to set drawing control properties?

D

Dave Taylor

Where is the appropriate place to set a Visio drawing controls properties?
For example, I don't want the page tabs displayed on the control, I've tried
in the Form's Load event, but this has no effect. I also tried after the
call to InitializeComponents, again no effect. Setting the properties in
response to a menu selection works just fine. My next solution is to use a
one-shot timer to set the properties but this method is very "kludgy"...any
other suggestions?

Thanks

Dave
 
M

Mai-lan [MS]

Hi, Dave: You can set drawing control properties at runtime or design time. The drawing control properties are the properties like SRC and HostID. The display page tab property and the other properties that relate to the display of the drawing surface are actually Visio object model properties, and can only be set at run time.

Check to make sure your control is part of the initialized control list. Once your control has been initialized, then set your properties. You shouldn't have to do this kludge. If your code in your other post is current, I'll take a look at it today..

Thanks
Mai-la
 
M

Mai-lan [MS]

Just to be clear, the kludge that I was mentioned we could avoid would be having to use a timer of some sort, as opposed to using an event handler. :)

Mai-lan
 
D

Dave Taylor

Mai-lan

Thanks for the reply. Using the Visio object model, I have tried setting
the drawing surface properties after the "InitializeComponent" call in the
Form's constructor with no success. The only way I can get this to work
thus far is by setting up a one-shot timer sort of thing (i.e. the Kludge).
The timer has a 100ms interval. Note, I've also tried setting the
..ShowPageTabs property in the form's Load event handler with no success.

-- Dave Taylor



** Code that DOESNT work
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
axFlowsheet.Window.ShowPageTabs = False 'This doesnt work
End Sub


** Code that DOES work
Private Sub tmrOneShot_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles tmrOneShot.Tick
Dim w As Visio.Window, pg As Visio.Page, sct As Visio.Section, r As
Visio.Row, c As Visio.Cell
tmrOneShot.Enabled = False
axFlowsheet.Window.ShowPageTabs = False 'This does work
...
End Sub


Mai-lan said:
Hi, Dave: You can set drawing control properties at runtime or design
time. The drawing control properties are the properties like SRC and HostID.
The display page tab property and the other properties that relate to the
display of the drawing surface are actually Visio object model properties,
and can only be set at run time.
Check to make sure your control is part of the initialized control list.
Once your control has been initialized, then set your properties. You
shouldn't have to do this kludge. If your code in your other post is
current, I'll take a look at it today...
 

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