Option Explicit
Private moCombo As cComboHelper
Private Sub cboFlintstones_GotFocus()
moCombo.AttachTo cboFlintstones
End Sub
Private Sub cboSimpsons_GotFocus()
moCombo.AttachTo cboSimpsons
End Sub
Private Sub Form_Load()
On Error Resume Next
' Placerar lite information i comboboxarna
' som vi kan använda för test
With cboSimpsons
.AddItem "Homer Simpson"
.AddItem "Marge Simpson"
.AddItem "Bart Simpson"
.AddItem "Lisa Simpson"
.AddItem "Maggie Simpson"
.AddItem "Mr Burns"
.AddItem "Moe"
End With
With cboFlintstones
.AddItem "Fred Flintstone"
.AddItem "Wilma Flintstone"
.AddItem "Barney Rubble"
.AddItem "Betty Rubble"
End With
With cboChoices
.AddItem "En"
.AddItem "Två"
.AddItem "Tre"
.AddItem "Fyra"
End With
'Skapa vår Combobox-hjälpreda
Set moCombo = New cComboHelper
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set moCombo = Nothing
End Sub