1. Greg Duvall
  2. PowerBuilder
  3. Wednesday, 5 September 2018 15:00 PM UTC

I have a "form" datawindow that users will enter scores into. It contains a single row with multiple entry columns on the form. When a user tabs to the next field I want to automatically scroll to that point. I have been trying any number of different approaches ( including using the VerticalScrollPosition/VerticalScrollMaximum) but without success. I have read the help files and maybe I am not fully understanding what it meant by "vertical scroll bar" and "scroll box" but trying to modify the verticalscrollposition is not doing what I expected. Thanks.

Greg Duvall Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 15:26 PM UTC
  2. PowerBuilder
  3. # 1

Chris, I had found similar code and had been trying that. What did resolve it was the answer from Miguel Leeuwe. I turned off autosize height and the tabbing worked. Thanks for everyone's input on this. I can't tell you how much I appreciate it. If you ever make it to Saint Louis, MO, look me up and we'll throw a few back! Thanks again.

Comment
  1. Miguel Leeuwe
  2. Thursday, 6 September 2018 15:32 PM UTC
YW Greg
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 15:13 PM UTC
  2. PowerBuilder
  3. # 2

here are my 3 fields, one up in the dw, another somewhere in the middle, and another at the end, near the detail band.

see attached 3 captures.

Attachments (3)
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 15:06 PM UTC
  2. PowerBuilder
  3. # 3

I've done something similar (very large dw detail height).

 

When I check the autosize height it stops auto-scrolling, please try to see if it works when you un-check the autosize height for the detail band. On my example it then works.

(so this is without any coding).

Comment
There are no comments made yet.
Greg Duvall Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 14:44 PM UTC
  2. PowerBuilder
  3. # 4

The images are after the changes suggested by Chris were made.

Comment
There are no comments made yet.
Greg Duvall Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 14:38 PM UTC
  2. PowerBuilder
  3. # 5

The DW is a tabular form with a SQL backend that when printed, would create 2 pages. The detail band autosize height is checked and the detail height is around 16.5 inches (in the DW painter). Attached are three images. The first one is when the tabpage is selected, the second is after hitting the tab key for the first time and the final image is after hitting the tab key a second time. Please not the position of the scroll bar,

Attachments (3)
Comment
  1. Chris Pollach @Appeon
  2. Thursday, 6 September 2018 15:08 PM UTC
Looks like you just need to subtract a small amount from the retrieved VerticalScrollPosition value to compensate the Scroll Position so that the headings 1,2,3,etc stay in view relative to the tabbed column.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 6 September 2018 13:58 PM UTC
  2. PowerBuilder
  3. # 6

Hi Greg;

  Give this code a try in the ItemFocusChanged event ...

long          ll_scroll
Int            li_rc
String        ls_describe
String        ls_modify = "DataWindow.VerticalScrollPosition = '"
String        ls_rc
String        ls_column


ls_column    =    String (dwo.name)
ls_column    += ".Y"
ls_rc           =    THIS.Describe( ls_column )
ll_scroll        =  Long  ( ls_rc)
ls_modify    += + String (ll_scroll ) + "'"
ls_rc           =    THIS.Modify ( ls_modify )

 

This should keep the DC scrolled to the current column at the top of the DC

HTH

Regards ... Chris

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 5 September 2018 23:59 PM UTC
  2. PowerBuilder
  3. # 7

After having cursor in column B and doing a TAB: see attachment.

Attachments (1)
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 5 September 2018 23:50 PM UTC
  2. PowerBuilder
  3. # 8

Hi, 

 

Maybe I don't understand completely what you mean with "automatically scroll to that point", but the scroll should be automatic.

Using powerbuilder 12.6, I've made a freeform external dw with 3 columns (A, B and C) and one row of fixed data.
Only the first 2 columns fit in the visible area of my dw control on a window.
when I tab, being in the second column, it automatically scrolls up.

I now see column B and C on the dw. (column A has scrolled up, out of the visible area).

Maybe you want to scroll to a specific different column ?

Attachments (1)
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.