SetFocus

  • Thread starter Maxime Maugeais
  • Start date
M

Maxime Maugeais

Good day,

Using CommandButtons, I want to click on a button (located on the left of
the page) and have the page scrolled to bring into focus the "button2" which
is located on the right hand side of the page.

me.button2.setfocus

However, SetFocus is not present in Visio. Its in Access but not in Visio.


Anyone knows why? How can I add it?

Thank you in advance

Maxime
 
C

Chris Roth [ Visio MVP ]

Slightly different approach required, as you're on a Visio page instead of a
form:

Check out Visio window methods:

SetViewRect
GetViewRect
ScrollViewTo

Also

SetWindowRect
GetWindowRect

are helpful.

You can scroll and zoom the Visio window as you wish per code, so finding
your button shouldn't be a problem.

--

Hope this helps,

Chris Roth
Visio MVP
 
M

Maxime Maugeais

Thanks for the help,

Looks like the "ScrollViewto" is what I am looking for, but i don't
understand the "as you're on a Visio page instead of a
form: Check out Visio window methods:"

I was typing the code in Visio VBA editor.

Thanks again

Max
 
C

Chris Roth [ Visio MVP ]

As far as I know, SetFocus is for forms and their controls. A Visio page
isn't going to behave 100% like a form.
 

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