Microsoft Office Excel ® Kod Kılavuzu

Microsoft Office Excel® Code Guide

10 Ekim 2007 Çarşamba

Image ComboBox





'UserForm1 

Option Explicit
Dim Liste As New ImageList
Dim Simge As Variant
Dim Kayıt As Variant
Dim i As Long
Dim No
Private Sub UserForm_Initialize() 
     On Error Resume Next 
     Me.Caption = "[PBİD®] Image ComboBox düzenleme...."ImageCombo1.Text = "Seçiniz"
     Simge = Sheets(1).Range("B2:B9").Value
     Kayıt = Sheets(1).Range("C2:C9").Value
     For i = 1 To 8
          Liste.ListImages.Add Key:="img" & i, Picture:=Sheets(1).OLEObjects(Simge(i, 1)).Object.Picture 
     Next
     Set ImageCombo1.ImageList = Liste
     For i = 1 To 7
          ImageCombo1.ComboItems.Add Index:=i, Text:=Kayıt(i, 1), Image:="img" & i, SelImage:="img8" 
     Next
     Set Liste = Nothing
End Sub
Private Sub ImageCombo1_Click() 

     On Error Resume Next
     If Not ImageCombo1.SelectedItem Is Nothing Then
          No = ImageCombo1.SelectedItem.Index
          Select Case No
          Case 1:MsgBox ImageCombo1.SelectedItem.Text
          Case 2:MsgBox ImageCombo1.SelectedItem.Text
          Case 3:MsgBox ImageCombo1.SelectedItem.Text
          Case 4:MsgBox ImageCombo1.SelectedItem.Text
          Case 5:MsgBox ImageCombo1.SelectedItem.Text
          Case 6:MsgBox ImageCombo1.SelectedItem.Text
          Case 7:MsgBox ImageCombo1.SelectedItem.Text
     End Select 
End Sub

Hiç yorum yok:

Blog Arşivi

Bu gadget'ta bir hata oluştu

Bu Blogda Ara

Contributor

Contributor
Mustafa ULUSARAÇ İstanbul, TÜRKİYE
free counters
T. C. Central Bank Indicative Exchange Rates
Currency Exchange Rate Widget,Currency Converter Widget
Borsa İstanbul