Private Sub BSComboBox1_OnDrawItem(ByVal Index As Long, ByVal Left As Long, ByVal Top As Long, _
ByVal Right As Long, ByVal Bottom As Long, _
ByVal State As BSAC.TBSOwnerDrawState)
BSComboBox1.Canvas.Brush.Color = CLng(BSComboBox1.Items(Index).Key)
BSComboBox1.Canvas.FillRect Left, Top, Right - Left, Bottom ' - Top
BSComboBox1.Canvas.TextOut Left, Top, BSComboBox1.Items(Index).Text
End Sub
Private Sub BSComboBox1_OnSelect()
Range("e1:p25").Interior.Color = CLng(BSComboBox1.Selected.Key)
End Sub
Private Sub UserForm_Initialize()
Dim I&, sh As Worksheet
Set sh = Sheets("COLOR")
BSComboBox1.Style = csOwnerDrawVariable
BSComboBox1.ItemHeight = 30
For I = 1 To 10
BSComboBox1.Items.Add sh.Cells(I, 1).Value, , , sh.Cells(I, 1).Interior.Color
Next I
End Sub
bu kod işe yarar mı
@benbendedeilem