Results 1 to 3 of 3

Thread: Is Control Loaded

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Is Control Loaded

    I am dynamically loading controls at runtime but what I need to do before I load a user control is check to see if it is already loaded.

    Any ideas ?

    TIA

    Parksie

  2. #2
    Addicted Member
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    198

    Re: Is Control Loaded

    Are you randomly loading them or something?

    If not, then I dont see the point of your question...
    If you are loading them, you know which ones are loaded and which are not.

    plz explain more

  3. #3
    "The" RedHeadedLefty
    Join Date
    Aug 2005
    Location
    College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
    Posts
    4,495

    Re: Is Control Loaded

    Why not have a private variable of the type of the user control, then check if it is nothing...
    VB Code:
    1. 'class level variable
    2. Private MyUserControl as UserControl
    3.  
    4. 'then code at runtime that declares a new instance of the variable
    5. MyUserControl = New UserControl
    6.  
    7. 'then to check to see if MyUserControl has an instance already
    8. If MyUserControl Is Nothing Then
    9.      'it doesnt exist, so declare a new instance
    10.      MyUserControl = New UserControl
    11. Else
    12.      'its already present, so do nothing, you could leave off the else statement
    13. End If

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