On 1/8/07, Robert Livingston <[EMAIL PROTECTED]> 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?

Because you're assigning a Window to the WindowInhabited property, not
a Window instance that has a StaticText1. A generic window has a width
property which is why "widthValue = Me.windowInhabited.Width" works.
If you can assign the window type that includes the StaticText1 to
WindowInhabited, the second line will also work.
_______________________________________________
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