Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2004, 11:15 AM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default Listbox Check

Hey

Anyone know how I can set a certain item of a listbox "checked" on startup of the application (so I guess on formcreate) but something like "listbox1.items[0].checked := True; doesn't work (which is logical as the listbox doesn't use such easy item handling as let's say a adoquerry...
Reply With Quote
  #2  
Old 12-12-2004, 11:30 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: Listbox Check

I believe you are talking about the TCheckListBox component, which has a Checked property, which is well documented in the Delphi Help...

gLes
Reply With Quote
  #3  
Old 12-12-2004, 11:38 AM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default RE: Listbox Check

Hey

No, I don't use the checklistbox component, just the standard one ... I don't need checkboxes either, I just want the first item in my listbox "selected" when I start my application
Reply With Quote
  #4  
Old 12-12-2004, 11:44 AM
gLes gLes is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,273
Default RE: Listbox Check

Oh..that...you misled me with the word 'check' in the question title

Simply put ListBox1.ItemIndex := 0; into the OnCreate event of your form

And better set the form's ActiveControl property to ListBox1 to insure that the listbox will have focus on the form at startup

gLes
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.