Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 374669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:25:41+00:00 2026-05-12T14:25:41+00:00

For an unknown reason, VB6 doesn’t interact the same way with UserControl than other

  • 0

For an unknown reason, VB6 doesn’t interact the same way with UserControl than other object.

I have a class that require to hold a graphical interface, a user control and need to be set to be later used from the get method. I have try many thing like using the special class VBControlExtender but without any success.

Here is what I have so far:

Class that hold variables and the user control:

'...
Private WithEvents m_uGUI As VBControlExtender

Public Property Get GUI() As VBControlExtender
    Set GUI = m_uGUI
End Property

Public Property Set GUI(ByVal uValue As VBControlExtender)
    Set m_uGUI = uValue
End Property
'...

Call of the class that cannot compile:

Set myObject.GUI = new ucMyUserControl

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:25:41+00:00Added an answer on May 12, 2026 at 2:25 pm

    From the help on this error (it mentions ListBox and Form, but the same applies to UserControls):

    The New keyword can only be applied to
    a creatable object… You tried to
    instantiate an Automation object, but
    it was not a creatable object. For
    example, you tried to create a new
    instance of a list box by specifying
    ListBox in a statement like the
    following: [sample code snipped]
    ListBox and Form are class names, not
    specific object names. You can use
    them to specify that a variable will
    be a reference to a certain object
    type… But you can’t use them to
    instantiate the objects themselves in
    a Set statement. You must specify a
    specific object, rather than the
    generic class name, in the Set
    statement:

    What you want to do is make an array of your UserControls and load new ones as you need them. Set the Index property of your UserControl to 0 to make it an array and then use the Load statement to create new instances:

    Load ucMyUserControl(1) 
    Set myObject.GUI = ucMyUserControl(1)
    

    When you need more just specify a new upper bound:

    Load ucMyUserControl(2) 
    Load ucMyUserControl(3)
    ...  
    

    When you’re done with them, unload them:

    Unload ucMyUserControl(3)
    Unload ucMyUserControl(2)
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 189k
  • Answers 189k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer How about: void rmdup(int *array, int length) { int *current… May 12, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer Updated Answer Regarding Optional Range Parameters Ok, after discussing the… May 12, 2026 at 5:45 pm
  • Editorial Team
    Editorial Team added an answer Something like this probably: [AttributeUsage(AttributeTargets.All)] public sealed class ValidateAsClientAttribute :… May 12, 2026 at 5:45 pm

Related Questions

For an unknown reason, I have 1 page that I can't access by ID
Someone left the organisation but before leaving, he locked all the files for an
I have a integer stored in TempData, and it is getting periodically wiped for
What is the XPath to find only ONE node (whichever) having a certain attribute
I am using NUnit (2.4.6) and my build/test night are done with Team City

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.