realbasic-nug
[Top] [All Lists]

Re: Creating Canvas array control on the fly

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Creating Canvas array control on the fly
From: Michael D Mays <michael@michaelsmanias.com>
Date: Mon, 15 Feb 2010 12:53:54 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <F08AF523-00A4-4CB1-9A2A-D4EF6769B903@classonesoftware.com>
References: <F628A17B-17A8-4207-9C13-EB10BBDF83A8@michaelsmanias.com> <8DB2C9C7-C9A8-4902-A703-A41B4C8A9865@tolisgroup.com> <5A1799D5-E2DC-4E5C-9AD6-2302680CDAB1@michaelsmanias.com> <F08AF523-00A4-4CB1-9A2A-D4EF6769B903@classonesoftware.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
On Feb 15, 2010, at 12:21 PM, Roger Clary wrote:

> 
> On Feb 15, 2010, at 12:54 PM, Michael D Mays wrote:
> 
>> dim MyNewerCanvas As MyCanvas
>> MyNewerCanvas.top = 100
>> MyNewerCanvas.Left = 199
>> MyNewerCanvas.Graphics.FillRect 0,0,100,100
>> 
>> but the FillRect statement generates an error because the graphic of 
>> MyNewerCanvas is nil.?? 
> 
> Do the drawing to all of your canvases in the .paint event of the canvas. If 
> the canvas is part of an array, you will have an index number passed to the 
> paint event so you can determine to which instance you are drawing.
> BTW - you do not HAVE to subclass canvas in order to create an array.
> 
> You can drag an instance of a canvas to your window in the IDE, give it a 
> name and an index number, (i.e. myCanvas) and then create new instances of 
> the array with
> 
> dim c As canvas
> 
> c = New myCanvas
> c.Top = ??
> c.Left = ??
> 
> etc.
> 
> 
> Roger Clary
> Class One Software
> http://www.classonesoftware.com
> Educational Software for Lifelong Learning

That works for me. 

I guess statements such as

Dim i as Integer
myControlArray(i) = someProperty

don't work/don't work all the time?

Thanks,
Michael


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

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


<Prev in Thread] Current Thread [Next in Thread>