Tcolorlistbox.selected property error.

hello all, I have a problem with selecting multiple entries in a Tcolorlistbox. My code.

for i := 0 to ColorListBox1.Items.count - 1 do
    if ColorListBox1.Selected[i] = true then
      memo1.Lines.Add('selected' + inttostr(i));

It wont compile and throws the error- 'E2016 Array Type required'.

The docs on tcolorlistbox only give an example using tfilelistbox similar to the code above.

Any info appreciated.
0
jim
7/31/2015 9:50:02 PM
embarcadero.delphi.graphics 928 articles. 0 followers. Follow

3 Replies
633 Views

Similar Articles

[PageSpeed] 16

ok, it seems the selected property returns the tcolor of the  selected entry.. 
ie.if ColorListBox1.Selected = Clred then whatever;

There does not seem to be a way to read multiple selections.
0
jim
8/2/2015 12:25:15 AM
jim cobold wrote:


> Any info appreciated.


TColorlistbox hides the selected property of TCustomlistbox, thus you
have to cast the object to Customlistbox:


{code}
procedure TForm2.Button1Click(Sender: TObject);
var i: integer;
begin
  Memo1.Clear;
  for i:=0 to ColorListBox1.Items.Count-1 do
  begin
    if TCustomListBox(ColorListBox1).Selected[i] then
      memo1.Lines.Add('selected ' + inttostr(i)+'
'+ColorListBox1.ColorNames[i] );
  end;
end;
{code}
0
Lajos
8/3/2015 4:02:50 PM
That does the trick. Can now get both color and selections ! thank you..

> {quote:title=Lajos Juhasz wrote:}{quote}
> jim cobold wrote:
> 
> 
> > Any info appreciated.
> 
> 
> TColorlistbox hides the selected property of TCustomlistbox, thus you
> have to cast the object to Customlistbox:
> 
> 
> {code}
> procedure TForm2.Button1Click(Sender: TObject);
> var i: integer;
> begin
>   Memo1.Clear;
>   for i:=0 to ColorListBox1.Items.Count-1 do
>   begin
>     if TCustomListBox(ColorListBox1).Selected[i] then
>       memo1.Lines.Add('selected ' + inttostr(i)+'
> '+ColorListBox1.ColorNames[i] );
>   end;
> end;
> {code}
0
jim
8/5/2015 10:53:35 AM
Reply:

Similar Artilces:

SELECT . FROM ( SELECT .. FROM )
Hi, In application we generate very effective SQL statements that are understandable by MS SQL Server and Oracle but give syntax errors on Sybase. I am talking about SELECT . FROM ( SELECT .. FROM a_table). For example: select 1 from (select abc_id from abc) or select 1 from (select abc_id from abc union all select abc_id from bcd) Is there any way to overcome this limitation? Any help will be greatly appreciated. Leonid Borisov Tefensoft On Wed, 15 May 2002 02:09:52 -0700, Leonid Borisov wrote: > Hi, > > > >...

PB Runtime error
I have an PB 7 application, build 8033, where when we run it in the development enviroment it runs fine, but when we try to do an Query by Example with the executable, the application fails with this error. We are using informix 7.03 as our database. Any ideas? Thanks George We tried this on a couple of other non powebuilder development machines, and the application runs fine. It appears either to be an invalid .dll on that machine or an issue with Citrix and PB702. Anyone else using PB702 and Citrix? THanks George Can you get the SQL-Syntax? geocal99@ya...

ERROR WHILE RETRIEVING (SELECT ERROR)
When the retrieve occurs te following error is produced Select error = This cursor based store procedure has no columns. Check the pbddms Dbparm and the procedure syntax The conection to the database is not via ODBC. The DBParm PBDBMS=0. I'm using PB 7.0.2. And I'm just simply using a datawindow which has a select (I can't use procedures o packages, I can only contruct the datawindow using a query). I�m using everything included in this version of PB. The data base is Oracle 9i and this application has been installed in Windows 98, Windows 2000 and Windows NT. What...

error error error
These are the 2 new errors i am getting now:   1).  Server Error in '/' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.Source Error: Line 53: ...

errors errors errors..
Name: harun Email: harunbjk1903hrnatgmaildotcom Product: Firefox Summary: errors errors errors.. Comments: first of all when i launch firefox (3) i cant enter websites via writing.. for example when I type "google" and then press ctrl and enter, it crashes.. and i take lots of error reports. firefox 2 was better.. see you again , harun Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9) Gecko/2008052906 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Datawindow Error: Select Error:
The title of the messagebox: Datawindow Error Message is: Select Error: Migrated 6.5 libraries to 8.0. SQL is build on the fly using dot notation(datawindow.table.select) add the where clause and set the sql using dot notation(datawindow.table.select). The datawindow still work fine in the 6.5 environment but not in the 8.0 environment. Why are the messageboxes coming up? I've recreated on of the datawindow and the select error goes away but there are many windows with datawindows retrieving data and we can't recreate our entire app...

Error, Error and more errors
Okay, all I wanted to do was test this app out and it has been a nightmare. 1.) Didn't install the sql database. I had to manually install it. 2.) I get errors when trying to add a picture to an album. "Procedure or function ngUpdatePicture has too many arguments specified" Any ideas? I've gotten more errors than this, but there is no use in bitchin. Are you using the v1.6.1 installer? Also, did you select to install the SQL Server db and give it a valid admin login? What were some of the error messages? Did you have an existing DB from a previous install? ...

Error: A field or property with the name was not found on the selected data source
I keep getting the following error when I run a web page with detailviewServer Error in '/Web' Application. A field or property with the name 'ProductID' was not found on the selected data source. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: A field or property with the name 'ProductID' was not found on the selected data source.Source Error: An unhandled exception was gener...

EAServer 5: Fatal error when selecting 'Server properties'
Hi guys! Successfuly installed EAServer 5.0 dev ed on XP pro Jaguar started as a service. When connecting with EAServer manager, tried to get the server properties, and got the following error messages (Jaguar.log): May 11 09:04:06 2004: A Fatal NT Exception [EXCEPTION_ACCESS_VIOLATION(0xc0000005)] was received while executing the method 'getServerEnvironmentVariables' of the component 'Jaguar/Management'. May 11 09:04:06 2004: Aborting Server... and the server goes down! Any ideas? Thanks for any help! JA PS. No problem when starting Jaguar as ...

Select error:Decimal conversion error
Environment: EAServer 3.0 PowerBuilder 7.0.1 I get the following error on generate dwMine with identity column. Failed during: Retrieve Select error: Decimal conversion error. PowerBuilder only supports 18 decimal digits. Any help? Thanks in advance. Mathew. Well, the message is pretty clear... what is the datatype of your identity column? What database? What database driver are you using to access the database? On Fri, 22 Sep 2000 12:12:33 +0200, Mathew Chacko <mathew_chacko@hotmail.com> wrote: >Environment: >EAServer 3.0 >PowerBuilder 7.0...

Datawindow Error: Select error: #2
Hi guys, during the stage of upgrade PB application from v6.51 to 9.0(backend upgrade from Oracle 8.1.6 to Oracle 9.2.0.), I want to use O84 driver in PB9 instead of O73 in PB6.5.1, but I got the error like this:"Datawindow error: Select error" in one of my datawindow when I try to preview it. here's my SQL statement for the datawindow. SELECT "SATREV_REPORT_VIEW"."TITLE", "SATREV_REPORT_VIEW"."ITEM_ID", "SATREV_REPORT_VIEW"."SUB_TITLE", "SATREV_REPORT_VIEW"."APPLIED_YEAR&...

DATAWINDOW ERROR : SELECT ERROR 1
HI all I am getting above error while retrieving a datawindow thru my application. The datawindow is made using stored procedure as data source and manual result set. I have taken only one column in result set. but its not working. while other datawindow with made using another stored procedure have no problem also it don't have any retrieval argument. I have searched forums already for this but is not of much help. Please HELP.Thanks Purva Can you retrieve this datawindow in the datawindow painter? What do you mean by "I have taken only one column in result s...

Select Error: Decimal conversion error
Hi, I just applied the PB 6.5.1 maintenance patch over PB 6.5 to solve the 'S1003 - Program type out of range' error. That seems to be fixed but now I'm getting a datawindow error 'Select Error: Decimal conversion error. Powerbuilder supports only 18 decimal digits'. I can understand what it means but I dont understand why we did not get this error when using PB 6.5 Has anyone faced this one? Can anyone shed some light? Thanks Ram I think that's always been an issue. Previously, however, PB would just truncate the data. On Thu, 14 Oct 1999 ...

Select Error: Decimal Conversion Error
Hi, I just applied the PB 6.5.1 maintenance patch over PB 6.5 to solve the 'S1003 - Program type out of range' error. That seems to be fixed but now I'm getting a datawindow error 'Select Error: Decimal conversion error. Powerbuilder supports only 18 decimal digits'. I can understand what it means but I dont understand why we did not get this error when using PB 6.5 Has anyone faced this one? Can anyone shed some light? Thanks Ram Thanks, I wont. "Bruce Armstrong [TeamSybase]" wrote: > I responded to this in another section. Please...

Web resources about - Tcolorlistbox.selected property error. - embarcadero.delphi.graphics

Resources last updated: 2/4/2016 8:33:15 PM