Jump to content


Photo

NG6.OnVerticalScroll does not have Position value


  • Please log in to reply
2 replies to this topic

#1 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 05 June 2023 - 01:32 PM

Hi, Boki:

 

In NG5.OnVerticalScroll event there is a Position param. In NG6.OnVerticalScroll there is no Position value.

 

How do I get the Position param value.

Thank you,

Chuck 

 

I am using it in this code:

 

WITH Grid DO
  BEGIN
    // if using scroll bar, it can go past the last row index causing a list
    // index out of bounds
    IF (Position > RowCount - 1) OR (Position < 0) THEN
    BEGIN
      // 5/23/09
      // 2/27/13 just exit without message
      // DoFPShowMessage('You have scrolled past the grid row limits: ' + IntToStr(position), 2000);
      // ShowMessage(IntToStr(position));
      exit;
    END;
    Repaint; // needed for XE2 paint problems
  END;


#2 BelangerC

BelangerC

    Senior Member

  • Members
  • PipPip
  • 221 posts
  • Location:Richmond, CA USA
  • Interests:Alternative medicine, programming for

Posted 09 June 2023 - 11:26 AM

Apparently I already figured this out in another part of my program.

Position exists as a property of VertScrollBar.

 

//Happening before this event is called.   DoGridVerticalScroll also tries to trap -1 row
if TNextGrid6(Sender).VertScrollBar.Position > -1 then
   DoGridVerticalScroll6(TNextGrid6(Sender), TNextGrid6(Sender)
    .VertScrollBar.Position)
    else
    Abort;
 
Chuck


#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 09 June 2023 - 10:21 PM

Hello Chuck,

 

Glad that you find it.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users