Recent

Author Topic: TComboBox.ReadOnly replacement  (Read 2314 times)

Milsa

  • Sr. Member
  • ****
  • Posts: 309
TComboBox.ReadOnly replacement
« on: November 25, 2018, 06:39:57 pm »
I am using Lazarus 1.8.4 and my project uses TcomboBox.ReadOnly property.

I will upgrade to 2.0 but I read this:
http://wiki.lazarus.freepascal.org/Lazarus_2.0.0_release_notes part TCustomComboBox.ReadOnly was deprecated

How do I replace this property in my code?
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TComboBox.ReadOnly replacement
« Reply #1 on: November 25, 2018, 07:41:35 pm »
The note itself offers a sugestion:
Quote
Remedy: Use extended styles for the same feature.

from which I conclude that you must do (in code or in the object inspector):
Code: Pascal  [Select][+][-]
  1. MyComboBox.Style := csDropDownList;

which style, acording to the documentation, means:

Quote
csDropDownList: The box has a drop-down list, from which entries can be selected (manual text entry disabled).
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Milsa

  • Sr. Member
  • ****
  • Posts: 309
Re: TComboBox.ReadOnly replacement
« Reply #2 on: November 26, 2018, 12:03:10 pm »
I am using autocomplete with dropdown list too. It is possible to use it with readwrite mode?
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: TComboBox.ReadOnly replacement
« Reply #3 on: November 26, 2018, 02:30:56 pm »
I think it's possible, yes. But try it and make sure yourself :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Milsa

  • Sr. Member
  • ****
  • Posts: 309
Re: TComboBox.ReadOnly replacement
« Reply #4 on: November 26, 2018, 05:19:06 pm »
I have old version. I will edit project after update Lazarus to 2.0. I will update later. I need any time for project changes.
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

Milsa

  • Sr. Member
  • ****
  • Posts: 309
Re: TComboBox.ReadOnly replacement
« Reply #5 on: November 26, 2018, 05:19:49 pm »
Thank you for your help.
I work with Lazarus 2.2.2, FPC 3.2.2, date 2022-05-15
This information is actual to: 28st Dec 2022

 

TinyPortal © 2005-2018