Recent

Author Topic: Text Property is conflicting with Items.Text for TCombobox  (Read 457 times)

jamie

  • Hero Member
  • *****
  • Posts: 6991
Text Property is conflicting with Items.Text for TCombobox
« on: April 27, 2025, 09:11:03 pm »
I spent some time trying to figure why comparing a String of Text from an old combo load verses a Text from the new combo load.

 I Was using the property TEXT which isn't actually the itmes.Text.

 The name is miss leading and I think it should be changed to CaptionText.

 I don't find this in Delphi btw.

Thank you.
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6991
Re: Text Property is conflicting with Items.Text for TCombobox
« Reply #1 on: April 27, 2025, 09:21:33 pm »
Excuse me, I guess DElphi does have the same property, that's a shame. what a blunder.

jamie
The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 17413
  • Ceterum censeo Trumpum esse delendum (Tnx Charlie)
Re: Text Property is conflicting with Items.Text for TCombobox
« Reply #2 on: June 01, 2025, 11:02:46 am »
You can already use the property Caption.
For some controls this is equivalent to text. The text property usually works for controls with Tstrings as content, for controls that do not have a Tstrings or a caption, it is equivalent to Text. TEXT is also use as a file, so it is not very smart to use texxt for anything else. It is your component that should change the name, not the standard controls.
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

 

TinyPortal © 2005-2018