Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox or Combo to return a value

Status
Not open for further replies.

JerryAttrick

Technical User
May 14, 2005
23
0
0
NZ
A combo box in Excel returns a value indicating which item on the drop-down list has been chosen. Can I do the equivalent in Delphi? How?
 
2 ways:
Combobox1.Items[Combobox.ItemIndex];
or
Combobx1.Text;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is always another way to solve it, but I prefer my way.
 
Thanks for the prompt answer. Can you suggest a tutorial or similar on the web where this function is described in more detail please? I'm pretty new at Delphi. Where do I store the list? How do I retrieve the number? An actual example would be very useful to me.

Thank you again,

JerryAttrick
 
Woo. You got me there. I haven't study Delphi by book, only by it's sourcecode.

When I started with Delphi,
I had no knowlegde what so ever regarding Pascal.

-"Learn Delphi in 5 ways":

* The absolute funniest way to learn code, is to check out the Delphi vcl/rtl sourcecode.
(C:\Program Files\Borland\Delphi 7\Source).

* Use Google to search for example code like "Delphi AND TCombobox".

* Another way to learn code, is to use the Help file. I think Delphi help file is one of the best helpfile written yet..

* The absolute best way is to join courses, but they are often very expensive.

* Books. (I have no experience about Delphi books)

Check out this sites:

Sorry for the abstract answer, but there aren't just one way to learn Delphi.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is always another way to solve it, but I prefer my way.
 
Many thanks for the information. This should keep me busy for a while!
 
Have you checked the FAQ section of this forum. A number of good resources for learning Delphi are listed in the following FAQs:
faq102-2794
faq102-5352

Hope this helps!

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Look in the help\examples directory, depending of your version of Delphi (I use Delphi 6) you may find combobox.dpr

Regards

Steven
 
Thanks to all your input I have vastly more information at my fingertips now and some real experienced gained. Needless to say, the things I needed were ther under my nose; I just had to learn how to use them. I now have a ComboBox function working very well on my current project (and a lot of other componenets as well now!).

Thanks again.
 
Good luck in the future...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There is always another way to solve it, but I prefer my way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top