
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