Results 1 to 3 of 3

Thread: Dynamic Creation of ocx-object

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45
    Hi,
    I have created an ocx object that I can use and load into a from within another of my vb-projects.

    But what I want to do is to dynamically create a visible instance of my ocx-object.

    Is there anyone out there who can give me some advise?
    Thanks,

  2. #2
    Guest
    You could try creating a control array of one copy of them in design mode which is invisible. Then you could add new copies when you want them via code and set the positions on the form as needed.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    45

    Thumbs up

    Thanks, that helped me to do what I needed to do.

    Here is my solution and piece of code to dynamically create instances of my ocx object incase anyone else ever has the same problem.

    In design mode I placed an invisible copy of my ocx-object.
    Then this piece of code creates the instances.


    'Load a new instance of the PresentationSheet into the control array
    Load PresSheetObj(intI)
    PresSheetObj(intI).Visible = False

    'Set the properties for the instance and retrieve the data
    PresSheetObj(intI).mstrViewID = mPresType(intI, 0)
    PresSheetObj(intI).mlngEvalID = mlngEvalID
    PresSheetObj(intI).mintLangID = mintLangID
    PresSheetObj(1).Left = mlngLeft
    PresSheetObj(1).Top = mlngTop

    PresSheetObj(intI).RetrieveData


    This worked fine for me.

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