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

ImageCombo Control

Status
Not open for further replies.

198311

IS-IT--Management
Mar 2, 2006
26
DE
hello,
How Can I Add images to the ImageCombo Control ???
there is no Row Source Property

??
bye
 
Unless this is some third party ActiveX control, I personally have never heard of a "ImageCombo" control. Are you referring to an "ImageList" control? This is how you populate and ImageList.

Code:
Public Sub subLoadImageList()
  Dim imgLstObject As ImageList
  Set imgLstObject = Forms("frmNode").imgLstNodes.Object
  imgLstObject.ImageHeight = 15
  imgLstObject.ImageWidth = 15
  imgLstObject.ListImages.Add 1, "SquadLdr", LoadPicture("C:\icons\SquadLdr.gif")
  imgLstObject.ListImages.Add 2, "Selected", LoadPicture("C:\icons\check.ico")
  imgLstObject.ListImages.Add 3, "UnSelected", 
End Sub
 
hello,
I have error wehen I Compile
"Application-defined or objec defined error"
in this line
Set imgLstObject = Forms("frmProblem").imgLstNodes.Object
imgLstObject.ImageHeight = 15

and this is my all source

Dim imgLstObject As ImageList
Set imgLstObject = Forms("frmProblem").imgLstNodes.Object
imgLstObject.ImageHeight = 15
imgLstObject.ImageWidth = 15
imgLstObject.ListImages.Add 1, "SquadLdr", LoadPicture("C:\icon\high.ico")
imgLstObject.ListImages.Add 2, "Selected", LoadPicture("C:\icon\low.ico")
imgLstObject.ListImages.Add 3, "UnSelected"


???

bye
 
Forms("frmProblem").imgLstNodes.Object

"imgLstNodes" is the name of my image list control. Did you use the same name?

Also you will need a reference to Microsoft Windows Common Controls (6.x)
 
thanks for your big help :)

this is my all code

Private Sub Form_Open(Cancel As Integer)

Dim imgLstObject As ImageList
Set imgLstObject = Me.ImageList3.Control
imgLstObject.ImageHeight = 15
imgLstObject.ImageWidth = 15
imgLstObject.ListImages.Add 1, "SquadLdr", LoadPicture("C:\icon\low.ico")
imgLstObject.ListImages.Add 2, "Selected", LoadPicture("C:\icon\high.ico")




End Sub

I have :
ImageCombo8
ImageList3
on the form

but where is use ImgeCombo8 ??

bye
 
hello,
I did exactly like on the microsoft web page.
It works - this is my code:

Dim objNewItem As ComboItem

Set objNewItem = imgCmb.ComboItems.Add(1, , "qw", 1)
Set objNewItem = imgCmb.ComboItems.Add(1, , "ty", 2)
Set objNewItem = imgCmb.ComboItems.Add(1, , "we", 3)
Set objNewItem = imgCmb.ComboItems.Add(1, , "er", 4)


objNewItem.Indentation = 1

But when I open form i must select Item from the list of the imagebox, because it's empty when i open the form.
Can I do something that when I open the form the firts of the list will be display in Imagebox ?? Or it will get from label , i tried this:

Dim aw As ImageCombo
Set aw = Me.imgCmb.Object

aw.SelectedItem.Text =me.Etykieta1.Caption

buti it doesn,t work :(

???
bye,
sorry for my english
 
If you follow the Links you will come to this page


Go to these pages and click on "properties", "methods", and "examples". You will find lots of good information.

In order to set the select a combo item, you need to use the comboItems collection which is 1 based I believe.

Private Sub Form_Load()
ImageCombo0.ComboItems(1).Selected = True
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top