Results 1 to 3 of 3

Thread: Create an ActiveX at RunTime

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    10

    Smile

    I wont to insert a MSFlexGrid in a Form of Access2000 File at RunTime.
    Well, Here is the sequence of operation that I made (Whithout success...sig).
    1) To made a reference with MSFlexGrid Library;
    2) To write This script:
    Dim obj as object
    set obj = CrateContol _(Myform,acCustomControl, etc.....)
    Now I do not know how to go on;
    How and were do I refer the class of MSFlexGrid to the control?

    Scuse my language but it is the first time that I write to this forum,
    usually I speak and write in my original language (Italian).
    Thankyou if you have an answar for my problem.
    Bye
    Last edited by gpalmia; Mar 5th, 2001 at 06:13 AM.

  2. #2
    Hyperactive Member Paul Warren's Avatar
    Join Date
    Jun 2000
    Location
    UK
    Posts
    282
    Sorry, but you can't do that with a control. The CreateObject function is for creating objects provided by other applications, such as Word, Excel, etc. If you want to dynamically create controls you will need to create one on your form and make it invisible. Set it's Index to 0 so it's part of a control array and then everytime you want to create a new one just do 'Load Control(n)'.
    Once it's loaded you can change properties before displaying it.

    If anyone else knows of a cleaner way of doing it then please share it with us but that's the only way I've found.
    That's Mr Mullet to you, you mulletless wonder.

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    Malaysia
    Posts
    71
    Hi, there's actually a way for dynamic control addition.
    The idea is to use a database to store the license key of the control and the info can be retrieved during run time.

    I have no time to expain it in length.
    But you could find the sample from the CD. They're named CtlCfg.vbp and CtlView.vbp.

    If you've installed the help file, then you can find it's description in:
    Visual Basic Documentation -> Samples -> CtlsAdd Sample.

    Sorry for not being more helpful.
    Hope someone else will post a detail working.

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