Recent

Author Topic: [SOLVED] Checklistbox question  (Read 2475 times)

bzman24

  • Jr. Member
  • **
  • Posts: 71
[SOLVED] Checklistbox question
« on: August 28, 2014, 02:16:11 am »
I have a project that is using a checklistbox.  The items are filled from the listing of filenames in a folder.  I use it to check the filenames, change the checked filenames and then I do a refresh or update to repopulate the checklist.  I can easily determine which rows have been checked, but is there a way I can have the checklistbox refresh and return to the same view that I had before the refresh?  In other words, I am checking rows 28, 29 & 30 out of 100 total rows.  In the view that I have when I check them, those 3 rows are at the top of the listing I see on the screen (I have scrolled the rows up to bring rows 28-30 at the top).  Is there a way to determine what the position of each row is so I can return the screen view to the same as before the refresh?

See attached picture.

Thanks for any help or thoughts on this.

BZman
================
Lazarus version: 1.2.4
Lazarus svn revision: 45510
Lazarus build date: 2014/06/14
Lazarus was compiled for i386-win32
Lazarus was compiled with fpc 2.6.4

Running on a Win7 desktop, 3 Gig of memory.
« Last Edit: August 28, 2014, 04:36:01 am by bzman24 »
==============
OS: Win7 - i5 - win64
Linux Mint 17.3
Lazarus: V1.8.2 / FPC - 3.0.4

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Checklistbox question
« Reply #1 on: August 28, 2014, 03:02:08 am »
Are you asking about checklistbox.TopIndex?

bzman24

  • Jr. Member
  • **
  • Posts: 71
Re: Checklistbox question
« Reply #2 on: August 28, 2014, 03:40:19 am »
Not sure.  I'm not familiar with that property.  Seeing your post and searching for that term, it just might be what I need.  Let me try that and see if it does what I want.  Funny in all the research I did on this, that never came up as an option.  Is that buried in the Free Pascal documentation?

Thanks,

BZman
==============
OS: Win7 - i5 - win64
Linux Mint 17.3
Lazarus: V1.8.2 / FPC - 3.0.4

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Checklistbox question
« Reply #3 on: August 28, 2014, 03:45:19 am »
It is one of the properties published on the Object Inspector. Here it is.

bzman24

  • Jr. Member
  • **
  • Posts: 71
Re: Checklistbox question
« Reply #4 on: August 28, 2014, 04:35:16 am »
engkin - thanks.  That does exactly what I want.  Yep, that is one of those properties that is right there but probably not used that much (sure true with me!!). Thats what I get for doing research but not fully experimenting with all of the properties available for a given component.  Great this forum comes thru again.  Thanks again engkin. :D :-[
« Last Edit: August 28, 2014, 04:39:11 am by bzman24 »
==============
OS: Win7 - i5 - win64
Linux Mint 17.3
Lazarus: V1.8.2 / FPC - 3.0.4

 

TinyPortal © 2005-2018