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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox and picture

Status
Not open for further replies.

SoftArt

Programmer
Feb 22, 2007
22
DE
Hi,
the RowSourceType of a ComboBox is 2=Alias. How can I use the Picture-Property for different pictures?

Thx from Germany
Thomas
 
You can't. You can only specify different pictures for each item in a combo or list when the control "owns" the data. That's the case for RowSourceType 0, 1 or 5.

Tamar
 
I thought this! So, I can change the RowSourceType to "Value" and add the data from the cursor or add a general field and fill it with the jpg I want.

Thank you for help
Thomas
 
Right, though I wouldn't use General fields for anything but temporary storage.

Tamar
 
Hi Tamor,

need your help one more time :)
I need another combobox on the same form with the same values and picturearray. Is there any way to copy these properties?
Thomas

 
What exactly do you mean here? If you want to copy arrays, look at ACOPY function in Help.
 
A combobox is filled with AddItemList and a different picture for every item. I need this combobox in the same form again for another choice. It´s easy to fill the second one like the first, but I think there is a way to copy the value to the second.
 
I see. I don't think it's possible or I can not think of a way for a moment. It would be possible if you would use arrays instead of values.
 
Your best bet would be to create a class that's set up as you want and then use two instances of the class on the form.

Since you've already set up the combo in the form:

1) MODI FORM and click on the combo.

2) Choose File | Save as Class from the menu.

3) Leave Selected Controls chosen in the option group.

4) Give a name to the class. I like something like cboDescription, that is "cbo" followed by something that tells what this is a combo of.

5) Enter or point to a class library in which to store the class.

6) Click OK.

7) Now remove the combo from the form and drop two instances of your new class onto the form instead.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top