Creating ActiveX Controls at Runtime using a Control Array 
Author Message
 Creating ActiveX Controls at Runtime using a Control Array

Does anyone know of any way to at runtime (changing of a control's
properties) creating multiple instances of ActiveX controls? Here's my code,
it gives me an error when it tries to change the property.

Public Property Get Codons() As Integer
    Codons = iCodons
End Property

Public Property Let Codons(ByVal NewCodons As Integer)
    ReDim Nucleotide(1 To (3 * NewCodons)) As Nucleotide
    lblCaption.Width = NewCodons * 1845
    For I = 1 To (3 * NewCodons)
        Set Nucleotide(I) = CreateObject(mRNAMolecule.Nuc)
        Nucleotide(I).Reverse = True
        Nucleotide(I).Top = 0
        Nucleotide(I).Left = (I - 1) * 615 + 135
    Next I
    iCodons = NewCodons
    PropertyChanged "Codons"
End Property

Thanks,
--Dave



Tue, 14 May 2002 03:00:00 GMT  
 Creating ActiveX Controls at Runtime using a Control Array
Which line gives you the error.

--

YMW

A Visual Basic Q&A Site:
http://members.aol.com/ymwymw/vbqa.htm
---------------------------------------------

Quote:
> Does anyone know of any way to at runtime (changing of a control's
> properties) creating multiple instances of ActiveX controls? Here's my
code,
> it gives me an error when it tries to change the property.

> Public Property Get Codons() As Integer
>     Codons = iCodons
> End Property

> Public Property Let Codons(ByVal NewCodons As Integer)
>     ReDim Nucleotide(1 To (3 * NewCodons)) As Nucleotide
>     lblCaption.Width = NewCodons * 1845
>     For I = 1 To (3 * NewCodons)
>         Set Nucleotide(I) = CreateObject(mRNAMolecule.Nuc)
>         Nucleotide(I).Reverse = True
>         Nucleotide(I).Top = 0
>         Nucleotide(I).Left = (I - 1) * 615 + 135
>     Next I
>     iCodons = NewCodons
>     PropertyChanged "Codons"
> End Property

> Thanks,
> --Dave



Wed, 15 May 2002 03:00:00 GMT  
 Creating ActiveX Controls at Runtime using a Control Array
Does anyone know of any way to at runtime (changing of a control's
properties) creating multiple instances of ActiveX controls? Here's my code,
it gives me an error when it tries to change the property.

Public Property Get Codons() As Integer
    Codons = iCodons
End Property

Public Property Let Codons(ByVal NewCodons As Integer)
    ReDim Nucleotide(1 To (3 * NewCodons)) As Nucleotide
    lblCaption.Width = NewCodons * 1845
    For I = 1 To (3 * NewCodons)
        Set Nucleotide(I) = CreateObject(mRNAMolecule.Nuc)

**I get a  424 (Obj. Required) in the line above**

        Nucleotide(I).Reverse = True
        Nucleotide(I).Top = 0
        Nucleotide(I).Left = (I - 1) * 615 + 135
    Next I
    iCodons = NewCodons
    PropertyChanged "Codons"
End Property

Thanks,
--Dave



Thu, 16 May 2002 03:00:00 GMT  
 Creating ActiveX Controls at Runtime using a Control Array
Quote:
>     ReDim Nucleotide(1 To (3 * NewCodons)) As Nucleotide

I'm not sure if this is the cause of your error but you should use a
different name than the type
Example:
ReDim MyNucleotide(1 To (3 * NewCodons)) As Nucleotide

--

YMW

A Visual Basic Q&A Site:
http://members.aol.com/ymwymw/vbqa.htm
---------------------------------------------

Quote:
> Does anyone know of any way to at runtime (changing of a control's
> properties) creating multiple instances of ActiveX controls? Here's my
code,
> it gives me an error when it tries to change the property.

> Public Property Get Codons() As Integer
>     Codons = iCodons
> End Property

> Public Property Let Codons(ByVal NewCodons As Integer)
>     ReDim Nucleotide(1 To (3 * NewCodons)) As Nucleotide
>     lblCaption.Width = NewCodons * 1845
>     For I = 1 To (3 * NewCodons)
>         Set Nucleotide(I) = CreateObject(mRNAMolecule.Nuc)

> **I get a  424 (Obj. Required) in the line above**

>         Nucleotide(I).Reverse = True
>         Nucleotide(I).Top = 0
>         Nucleotide(I).Left = (I - 1) * 615 + 135
>     Next I
>     iCodons = NewCodons
>     PropertyChanged "Codons"
> End Property

> Thanks,
> --Dave



Sat, 18 May 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Creating controls at runtime & Control arrays

2. Creating Controls at runtime & Control Arrays

3. Creating dynamic / runtime controls in control array

4. Dealing with runtime created control arrays

5. Creating Control Arrays at RunTime

6. Creating a Control Array at Runtime.

7. Creating Control Arrays at Runtime

8. Create control array at runtime?

9. Creating a control array at runtime

10. COM Interop - Create ActiveX Controls at runtime.

11. Creating ActiveX controls at runtime...

12. Creating ActiveX controls at runtime

 

 
Powered by phpBB® Forum Software