Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. problem in Dynamically adding objects of user control

problem in Dynamically adding objects of user control

Scheduled Pinned Locked Moved Visual Basic
helpcom
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 1194469
    wrote on last edited by
    #1

    Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..

    D J 2 Replies Last reply
    0
    • U User 1194469

      Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You might want to post the code your using so we can see what's going on. Adding the control is as easy as Dim myControl As New myActiveXControl and then adding it to the Form's controls collection. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • U User 1194469

        Hello EveryBody I implemented one ActiveX Control in Visual Basic 6.0. And I want to add instances of this control (Dynamically) in new control or new form. But VB is not allowing me to Set object to ActiveX control. (it allow to declare object but problem is in set operation).:eek:...every suggtion and help is regreated..

        J Offline
        J Offline
        James Gohl
        wrote on last edited by
        #3

        Here try this it should allow you to create infinate instances of and object using a dynamic array... (First of all set the index property of your ActiveX object to 0) { Private Sub CreateNewActiveXObjectInstance() Load ActiveXObject(ActiveXObject.UBound + 1) 'Object Upper-Boundary increases by 1 now ActiveXObject(ActiveXObject.UBound) = ActiveXObject(ActiveXObject.UBound - 1) 'If the previous line gives you an ERROOOOOORRRRRGH! then try setting 'the properties of the new object, bearing in mind you have just created 'a new instance in memory, all of its property values will be empty. 'e.g. ActiveXObject (ActiveXObject.UBound).[Property] = [Value] End Sub Call this routine everytime you want to create a new instance of the object :) };

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups