DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to tell if control is loaded

  1. #1
    Tim Cowan Guest

    How to tell if control is loaded

    Hi

    I am loading command buttons at run- time in a control array. Is there
    anyway to see if a particular element is already loaded? somthing like:

    If IsLoaded(Mycmd(3)) then "Don't try to load it again"

    Can anyone suggest a way to test or do I have to wait for the error to be
    generated and go from there.

    Thanks

    Tim Cowan



  2. #2
    Larry Triezenberg Guest

    Re: How to tell if control is loaded

    Well, the easy way may be to trap the error, but you could do something like
    this:

    Dim ctl As Control
    Dim bFound As Boolean

    For Each ctl In MyCmd
    If ctl.Index = 3 Then
    bFound = True
    Exit For
    End If
    Next ctl
    If bFound Then
    MsgBox "Found it"
    Else
    MsgBox "Not found"
    End If

    Hope that helps,
    Larry

    Tim Cowan wrote in message <38f4b95c@news.devx.com>...
    >I am loading command buttons at run- time in a control array. Is there
    >anyway to see if a particular element is already loaded? somthing like:
    >
    >If IsLoaded(Mycmd(3)) then "Don't try to load it again"
    >
    >Can anyone suggest a way to test or do I have to wait for the error to be
    >generated and go from there.



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