DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Need to know what kind of control is ...

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Need to know what kind of control is ...

    [Originally posted by Marco Negri]

    Hi.
    I have a sub that have an argument of type Object.
    Into the sub, I would like to test if the object
    support the PaintPicture method, but I dont know how.
    Thanks for any help.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Need to know what kind of control is ...

    [Originally posted by reggx]

    Why don't you put On Error Resume Next, then try to execute the PaintPicture method and trap for Err.Number equal to zero. If Err.Number is zero then PaintPicture would be a valid method of the Object.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Need to know what kind of control is ...

    [Originally posted by Marco Negri]

    Thank you very much.
    I will try your suggest; another choice I found on a book is using the statement " If TypeOf obj Is
    (Control) Then "; it also work well.

    Bye

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center