insert item in imagecombo

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

insert item in imagecombo

Post by sal21 »

I use this code to fill an imagecombo.

Code: Select all

Private Sub APRI_COMBO()

    With Me.IMGCOMBOSTATO
        .ComboItems.Clear
        Set .ImageList = Me.ImageList1
        For K = 1 To Me.ImageList1.ListImages.Count
            STATO = Me.ImageList1.ListImages(K).Key
            .ComboItems.Add , , STATO, K
            If InStr(STATO, "ITALY") > 0 Then J = K
        Next K
        Me.LNR.Caption = K
    End With
    Me.IMGCOMBOSTATO.Text = Me.IMGCOMBOSTATO.ComboItems.Item(J).Index'<<<<<

End Sub
to the and i need to insert in imagecombo.txt the item found with J, in my case ITALY is J=120
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: insert item in imagecombo

Post by HansV »

Set IMGCOMBOSTATO.SelectedItem = IMGCOMBOSTATO.ComboItems(J)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4354
Joined: 26 Apr 2010, 17:36

Re: insert item in imagecombo

Post by sal21 »

HansV wrote:
11 Feb 2022, 21:54
Set IMGCOMBOSTATO.SelectedItem = IMGCOMBOSTATO.ComboItems(J)
:thankyou: