Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2012, 09:31 AM
jeidee jeidee is offline
Junior Member
 
Join Date: Oct 2009
Posts: 22
Send a message via Yahoo to jeidee
Default listbox1 click items show images

anybody help me


can u share the code ex:

i have image c:/photo folder

inside the photo folde have cofee image candy image

now

listbox1 inside the listbox1 have cofee candy now if i click the cofee inside in the list box show the image came from c:/photo

now show in image1


thanks who help me
Reply With Quote
  #2  
Old 08-28-2012, 11:54 AM
Donovan Donovan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 150
Send a message via Skype™ to Donovan
Default

you want us to write the entire piece of code?

Why not have a go at it yourself and if you run into problems then ask for help?

You wont learn anything if you are just given the answer...
Reply With Quote
  #3  
Old 08-28-2012, 06:41 PM
jeidee jeidee is offline
Junior Member
 
Join Date: Oct 2009
Posts: 22
Send a message via Yahoo to jeidee
Default

here my error vod


var
bfast1:string;
begin

bfast1:=(ListBox1.Items[ListBox1.ItemIndex]);

if (bfast1='day2') then
Image1.Picture.LoadFromFile('C:\drinks\soda/coke.png'); = ok
Image2.Picture.LoadFromFile('C:\cake\Thumbs/ube.jpg');=ok
Image3.Picture.LoadFromFile('C:\rttr\rt54/juices.png'); =ok

if (bfast1='day1') then
Image1.Picture.LoadFromFile('C:\drinks\soda/coke1.png');=ok
Image2.Picture.LoadFromFile('C:\cake\Thumbs/ube2.jpg');= error nothing change
Image3.Picture.LoadFromFile('C:\rttr\rt54/juices3.png');= erorr nothing change

end;
Reply With Quote
  #4  
Old 08-29-2012, 06:36 AM
Donovan Donovan is offline
Senior Member
 
Join Date: Jan 2011
Posts: 150
Send a message via Skype™ to Donovan
Default

try repainting the images one they are loaded?

Image2.repaint

Or add in Application.processmessages after each load
Reply With Quote
  #5  
Old 09-06-2012, 04:59 PM
emailx45 emailx45 is offline
Junior Member
 
Join Date: May 2012
Posts: 18
Thumbs up

Dear friend,

TListBox, can store "Strings" or "Object" - see the help your delphi

Point 1:

Why you dont use one database (or table) for store your images?

Ex.: Table_my_Images_for_ListBox

fields: ID, Description, Path, BLOB(Image)

So, you can to use 1 DBlistbox. Clear, always check the path and file for your existence in disk, if needed!

Using one database (FIREBIRD, INterBase, etc...) you can store the images, so, take easy for your software!

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:06 AM.


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