On May 14, 2007, at 5:18 AM, Emile Schwarz wrote:

> I wanted to clone a Control (2007r2) and I have troubles:
>
> nothing appears on the target window (1)
>
> I added an 'introspection' / report method and can see the properties
> (different y value BUT not the Control name...)
>
> More disturbing is an old test project: the code works fine in its
> original project, but displays an error when I included it in my  
> project:
>
>     Dim p(4) As PushButton
>     Dim i    As Integer
>
>     For i = 1 to 3
>       p(i) = New PushButton1
>       If p(i) <> Nil Then
>         p(i).Top = 30 + (30 * i)
>         p(i).Left = 230
>         p(i).Caption = "Cloned PB #" + Str(i)
>         p(i).Width = 100
>       End If
>       If UserCancelled Then Exit
>     Next
>
> The reported error is:
>
> There is no class with this name.
> p(i) = New PushButton1
>
>
> Of course, there is a PushButton1 Control on the window (in both  
> projects).

Your code works fine *if* Pushbutton1 has an index. Otherwise the  
error you reported occurs.

Terry

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to