View Full Version : combobox problem plz help
i want to put 4 pictures in combobox, and if i want to open one of them :
i have to select one picture to see it on the main page i mean near combobox
before i open it , then i click on button to open it .
i don`t know if you undestant that or not :huh
if you have an example for that it will be helpfull
many thanks
TJ_Tigger
06-20-2007, 10:20 AM
how do you want to open the file? Load it into an image object within AMS or open it in the systems configured image viewer/manipulation software?
Load it into an image object within AMS
TJ_Tigger
06-20-2007, 10:51 AM
I guess this is what I would do.
Load the image information into the Combobox with the filename is the CB Text and the full path to the file would be the DB Data component.
Place script into the On Select for the Combobox (or the On Click for a button) that would identify the selected object in the CB and then obtain the full path to the file from the Data portion of the selected object. Store this in a variale.
Use the variable from the previous step to load into an image object. Before doing this you may want to do a quick check to ensure that the image object actually exists before trying to load it.
Tigg
sorry TJ_Tigger you know i can`t follow you like that , can you make for me
just small example for one picture , if you can
and sorry to take from your time
RizlaUK
06-20-2007, 11:53 AM
if i understand you correctly then this example should suit your needs
thank you RizlaUK you always ready for help ... you are the best
many thanks
RizlaUK i want to view the picture when i select it from the combobox
then i click the button to open it
this what i want .....
i didn`t sleep last night till 4 morning ....realy it make me sick
TJ_Tigger
06-22-2007, 10:02 AM
RizlaUK i want to view the picture when i select it from the combobox
then i click the button to open it
this what i want .....
i didn`t sleep last night till 4 morning ....realy it make me sick
Can you show us your project or the code from your project and we can help you move forward. Sorry to hear about you being sick.
Tigg
RizlaUK
06-24-2007, 10:48 AM
hey jack, i agree with tigg, it helps us and you if you post the code you have and we will look from there
but for what you want to do, i would suggest not spending hours on end trying and spend a few hours researching the available functions and what thay do from the manual
to load a image from a combobox (assumeing the path to the file is already in the data field of the combo)
selData = ComboBox.GetItemData("ComboBox1", e_Selection);
Image.Load("Image1", selData);
and to open the image in the users default image viewer
sel = ComboBox.GetSelected("ComboBox1");
selData = ComboBox.GetItemData("ComboBox1", sel);
File.Open(selData, "", SW_SHOWNORMAL);
of course these are basic codes, you should add some error checking along the way
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.