Typeof controls of a transfer form

I have two ActiveX controls. The first transfers to the second a form, and the second searchs into this form determinate controls. The problem is that the second ActiveX can't recognized the 'Typeof' this controls like textbox, comand button, label... When I watch one of this controls in the Type column of the Watch Window appears 'Control/Label' in label case, or 'Control/Textbox' in Textbox case.
How can I know the Typeof this control in this case?
Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Check if TypeName can be used instead of TypeOF.
abautistatAuthor Commented:
Correct. Thank you for your answer
Try using the following to check:

If TypeOf Control Is VB.TextBox Then MsgBox (Control.Name & " Is Textbox")
If TypeOf Control Is VB.Label Then MsgBox (Control.Name & " Is Label")
Éric MoreauSenior .Net ConsultantCommented:
So you can now Accept this comment as an answer! You have a command button on the green line that will allow you that.
abautistatAuthor Commented:
Sorry, I forgot to clik in the correct button.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.