Recent

Author Topic: Listbox: Trouble with GetSelectedText  (Read 12919 times)

khoward

  • New Member
  • *
  • Posts: 39
Re: Listbox: Trouble with GetSelectedText
« Reply #15 on: May 30, 2013, 03:04:22 pm »
Whoops....

I misunderstood you.

Code: [Select]
ListBox2.ItemIndex :=0;
ListBox2.Selected[0];
ShowMessage(ListBox2.GetSelectedText);

That's how I tried it....note my misuse of Selected[0].
I'll try again.
Thanks Taaz.

Keith

khoward

  • New Member
  • *
  • Posts: 39
Re: Listbox: Trouble with GetSelectedText
« Reply #16 on: May 30, 2013, 03:19:38 pm »
Ok, Taaz....

I tried:

Code: [Select]
ListBox2.ItemIndex :=0;
ListBox2.Selected[0] := True;
ShowMessage(ListBox2.GetSelectedText);

Which was empty.
Soooo.....is it a bug or by design?  Or am I misunderstanding something?

I think I understand the workaround now....the workarounds provided are just getting the text property of the first item in the list, which is sufficient for my needs for now.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Listbox: Trouble with GetSelectedText
« Reply #17 on: May 30, 2013, 03:31:41 pm »
By my logic it is a bug. I would reported it on the bug tracker and let the masters there do their magic.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

khoward

  • New Member
  • *
  • Posts: 39
Re: Listbox: Trouble with GetSelectedText
« Reply #18 on: May 30, 2013, 03:33:49 pm »
Cool, Thanks Taaz!

khoward

  • New Member
  • *
  • Posts: 39
Re: Listbox: Trouble with GetSelectedText
« Reply #19 on: May 30, 2013, 03:35:52 pm »
Awww, man......Taazz.....Sorry, I was misspelling your name!  :-[

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Listbox: Trouble with GetSelectedText
« Reply #20 on: May 30, 2013, 03:53:51 pm »
No worries, its just a nick it should've been taz like the Tasmanian devil in the cartoons, but it was too short so i just added a couple of duplicate letters.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

khoward

  • New Member
  • *
  • Posts: 39
Re: Listbox: Trouble with GetSelectedText
« Reply #21 on: May 30, 2013, 04:04:24 pm »
Ok, Taazz.....per your suggestion, I reported a bug.  It's ID is 0024515, for reference.

Thanks to all.

Keith

 

TinyPortal © 2005-2018