0

Hi,

I am working in an application that uses Drag & Drop in VB6, and I need to determine which type of control is the user dragging.
I have in the form several controls: PictureBox, TextBox and ListBox.
I know that I can use TypeOf() in VB .Net, but, what can I use in VB6?

Thanks in advance!

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by dmf1978
0
Dim ctl As Control
For Each ctl In Me.Controls
    If TypeOf ctl Is TextBox Then
    'do something
    ElseIf TypeOf ctl Is ComboBox Then
    'do seomething
    else
    'do something
    End If
Next ctl
0

Thanks!
I was using something like this:

If TypeOf (ctl) Is TextBox Then
    ...
End If

The problem is with "(" and ")". It doesnt work in VB6.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.