You'll have to provide a socket (object-reference property) in your custom canvas if you want to manipulate another control's state (properties) or call any of its methods. I don't believe RB windows have a global (for the window) control list (or other iterable container) object that you can get to. It's much like making an outlet in ObjC/Cocoa.

On Jan 8, 2007, at 1:13 PM, Robert Livingston wrote:

I have a canvas class (AnaCanvas) that sits in a window.

I have experimented with that canvas class having a property (windowInhabited) and that property is the window in which it lives

When the window opens (the window that contains the canvas instance myAnaCanvas), the canvas instance windowInhabited.property is assigned the window

Using that concept, I am able to get the width and height of the window, when I want, within methods of the canvas class.

However, I would like to have the canvas control have access to other window controls (in my case a static text box)
That does not seem to work.


Open Event of  mainWindow

Self.myAnaCanvas. windowInhabited = Me


_________________


Some method of the AnaCanvas


Dim widthValue As Integer

widthValue = Me.windowInhabited.Width 'this works

BUT

Me.windowInhabited.staticText1.Text = "Frog"

Does NOT work.



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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to