Scroll Position

C

ChipD

Is there a way to save and set the scroll position in a view (similar to
scrollTop property in DHTML)?

We have several views in our InfoPath form, one that contains a list that
scrolls vertically. This view contains a button that takes them to another
view. When the user is on this view and moves to a different view, then back,
it would be very nice to restore the user's vertical scroll position so that
they don't have to scroll down to find where they were.

Thanks!
 
F

Franck Dauché

Hi,

One way to do this is to get the focus to the control where you want to go
by code using code such as :
IXMLDOMNode oNode =
thisApplication.ActiveWindow.XDocument.DOM.selectSingleNode(YourTargetNodePAth);
thisApplication.ActiveWindow.XDocument.View.SelectText(oNode,Missing.Value);

For example, you can write code to "jump" to a textbox or to an optional
section that way.

If you store the path of your source control in a global var, you can use it
to jump back in the right place after you switch back to your original View.

Hope that helps.

Franck Dauché
 
C

ChipD

That works great. Thanks!
--
Chip Davis


Franck Dauché said:
Hi,

One way to do this is to get the focus to the control where you want to go
by code using code such as :
IXMLDOMNode oNode =
thisApplication.ActiveWindow.XDocument.DOM.selectSingleNode(YourTargetNodePAth);
thisApplication.ActiveWindow.XDocument.View.SelectText(oNode,Missing.Value);

For example, you can write code to "jump" to a textbox or to an optional
section that way.

If you store the path of your source control in a global var, you can use it
to jump back in the right place after you switch back to your original View.

Hope that helps.

Franck Dauché
 

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