Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8263343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:04:06+00:00 2026-06-08T04:04:06+00:00

Is there a way to populate a TListbox control with items from a database

  • 0

Is there a way to populate a TListbox control with items from a database column?

I know the proper way to do this is to simply use a DBLookupListbox control and set it up to access the column I want, but the problem with that is when I click on one of the items in the lookup control, it changes the current row in the dataset (expected behavior) but I do not want this to happen.

Instead, I would want the current row to be changed only on a double click event in the lookup control and since I do not think this behavior is possible to change, I thought it would be easier to simply use a normal TListBox instead, but as I stated above, I am not sure how it’s done.

So once again, I have come to the experts for some advise on how to populate a normal Tlistbox control with items from a database column.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:04:07+00:00Added an answer on June 8, 2026 at 4:04 am

    There are a myriad of ways to solve your problem. You could create a hacked control of a TDbLookupListBox and override the Click method to do nothing. You could also create a second dataset to be used for your lookup. But as you wish, to populate a TListbox, you simply iterate the dataset and add the field value to the listbox as:

    tLogin.first;
    while not tLogin.eof do
    begin
      Listbox1.Items.Add(tLogin.fieldbyname('fullname').asstring);
      tLogin.next;
    end;
    

    If you need a key value based on a selection, then this won’t solve your problem entirely. You’d be better off hacking the TDbLookupListbox control, imo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to safely populate a byte array from multiple threads (e.g.
Is there any way to populate TCP-H database for Microsoft SQL Server 2008. TPC-H
Is there a way to pre-populate a database table w/ a migration in Rails
Is there an easy way to populate one form field with duplicate content from
Is there a way to populate a Dynamic object with Query String parameters? This
For a simple plot below, is there a way to make matplotlib populate the
Is there way to get file from windows xp command prompt? I tried to
is there way how to get name ov event from Lambda expression like with
Is there way to mute an audio stream or at least control the volume?
Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.