CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2000
    Posts
    737

    how to get the object type

    How do we get the object type ?

    for instance,

    if we got a function c(d as object) where d is any object.

    how can we determine the type of object, whether it is textbox, label, etc

    thanks.




  2. #2
    Join Date
    Mar 2001
    Location
    Australia
    Posts
    146

    Re: how to get the object type

    Try this:



    If TypeOf d is TextBox then
    MsgBox "Text Box"
    End if





    You could also use Select Case for different types.

    The Types are any control (eg. Label, CheckBox). VB should provide you with a list after you type Is.

    Hope this helps,

    Nathan Liebke


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured