isa combobox

if i put on a window a combobox and then loop all controls with:

for i as Integer = 0 to self.ControlCount - 1 dim ctl as Control = self.Control(i) select case ctl case isa PopupMenu MsgBox "Popupmenu" case isa ComboBox MsgBox "Combobox" end select next

i get every time a popupmenu, only if i copy the part of combobox before the popupmenu part, works right.

It’s a bug or?

Combobox is a subclass of PopupMenu. So you need to swap the two Case statements:

for i as Integer = 0 to self.ControlCount - 1 dim ctl as Control = self.Control(i) select case ctl case isa ComboBox MsgBox "Combobox" case isa PopupMenu MsgBox "Popupmenu" end select next

… or you could also do this:

for i as Integer = 0 to self.ControlCount - 1 dim ctl as Control = self.Control(i) select case ctl case isa PopupMenu If ctl isa ComboBox Then MsgBox "Combobox" else MsgBox "Popupmenu" end if end select next