1. Gary Cooper
  2. Elevate Discussion
  3. Tuesday, 11 July 2023 14:26 PM UTC

I have a datawindow with one column that contains text of 25,000 characters.  It has a vertical scroll bar, however, the requirement is that the scroll bar automatically scrolls down if the text is more than is initially visible. 

How do i get the scroll bar to scroll to the bottom of the datawindow if there is more text than is visible in the opening window.

Gary Cooper Accepted Answer Pending Moderation
  1. Wednesday, 12 July 2023 15:33 PM UTC
  2. Elevate Discussion
  3. # 1

Hi Chris, 

 

I got it to work by putting your code in the Activate Event of the parent window.

 

Thanks You, i really appreciate your solution.

Gary

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 12 July 2023 17:31 PM UTC
Hi Gary;

Another great location to perform that auto scrolling code!

Super glad that it all worked out!

Don't forget to hug a DataWindow today! ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
Gary Cooper Accepted Answer Pending Moderation
  1. Wednesday, 12 July 2023 15:20 PM UTC
  2. Elevate Discussion
  3. # 2

Hi Chris,  Thanks for the quick response. 

I tried your solution by putting the code in a button (cb_scroll - Clicked! Event)  on the parent screen and when clicked it works:

long ll_comlength
dw_comment.SetFocus()
ll_comlength = len(dw_comment.GetText())
dw_comment.SetColumn(1)
dw_comment.SelectText (ll_comlength, 0)

 

However, i would like a more subtle solution, not making the user click the button like:

1. putting the code in the Open Event of the parent window (it doesn't work from there)

2. calling cb_scroll.TriggerEvent(Clicked!) from the parent window to the button (it doesn't work, in fact, i ran it in debug and it triggers the button but it doesn't activate the code) What????

Any other ideas?

 

 

 

Comment
  1. John Fauss
  2. Wednesday, 12 July 2023 16:07 PM UTC
Hi, Gary - You may wish to consider performing this action only when the column in question receives input focus. To do that, use the DataWindow control's ItemFocusChanged event. The event argument called "row" will tell you the row number, and the "name" property of the event argument called "dwo" will tell you the name of the column that has received input focus (If dwo.Name = "mytextcolumn" Then...End If).
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Wednesday, 12 July 2023 17:29 PM UTC
Hi Gary;

Awesome .. thanks for the feedback

John has a good suggestion for this action when the DWO's column gets Focus.

Suggestion: You could also use this code in the DW Control's RetrieveEnd event as well if you always want this column auto scrolled upon data arriving.

Food for thought. ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 11 July 2023 20:50 PM UTC
  2. Elevate Discussion
  3. # 3

Hi Gary;

  Since I asume that you mean scroll to the last character of the large text column....

  1. Use the Len (GetString()) + 1 command to get the data size
  2. Use the SetColumn() command to set the user's focus to the large text column in question.
  3. Then use the long dwcontrol.SelectText ( long <step#1>, long 0)

Step#3 should position the user at the last character of text in the large text Column & thus force the DW Control to scroll at the same time.

HTH

Regards ... Chris

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.