I would recommend using Getter and Setter methods in the
ContainerControl to access the data you need.
So, for example.
You craft a containercontrol (called cc) with an editfield embedded
within it (called ef)
In the cc, add a method GetText
Function GetText()
return ef.text
EndSub
and a method called SetText
Sub SetText ( theText )
ef.text = theText
End Sub
Make both methods Public.
What this has essentially done is 'isolate' the ef control from the
outside world. i.e. if you decide to change the editield to some
other control in the future, you will only need to modify the
GetText and SetText methods.
So now you drag an instance of the cc to panel 0 on your tab panel on
a window.
From any methods you add the window, you can now access your
editfield as such:
someText = cc.GetText
and
cc.SetText( "cool" )
So in your example, you are trying to populate a listbox on panel 1
from the text from the cc on panel 0
Whenever you want to grab the data from the containers editfield,
whether it be a method of the window, or another control, you can do
this
Listbox1.AddRow cc.GetText()
Hope that helps
Jay Wooten, President
Go Data Systems, Inc.
www.godatasystems.com
[EMAIL PROTECTED]
On Jun 29, 2006, at 8:36 PM, CV wrote:
On Jun 28, 2006, at 4:58 PM, Stephen wrote:
Hi,
I have a window with a PagePanel and ContainerControls on the
pages - so that I can use the ContainerControls in other places...
Anyway - I'm trying to access the .Text value of a control on the
ContainerControl on page 1 (0), to populate a listBox on the
ContainerControl on page 2 (1).
I'm having trouble figuring out the hierarchy of it I think...
I keep getting "This method or property does not exist"
I've tried:
Dim instructer As String
instructor = instructorComboBox.Text // hoping it will just see it!
or
instructor = newLessonContainer.InstructorComboBox.Text // does
see it - but still give me the error!
This has made me waste a whole day!
Thanks!
Stephen
The way I do that is to embed the ContainerControls in code and
retain references to them in window properties. Perhaps someone can
show us a better way but in the meantime here's what I do, as an
example:
Add two window properties: mContainerControl1 as ContainerControl1
and mContainerControl2 as ContainerControl2
Then in window_Open:
dim cc1 as ContainerControl1 = new ContainerControl1
cc1.EmbedWithinPanel PagePanel1, 0, 0, 0
self.mContainerControl1 = cc1
dim cc2 as ContainerControl2 = new ContainerControl2
cc2.EmbedWithinPanel PagePanel1, 1, 0, 0
self.mContainerControl2 = cc2
Then you can reference individual controls on the ContainerControls
like this, for example:
MsgBox self.mContainerControl2.EditField1.Text
MsgBox self.mContainerControl1.EditField1.Text
Best,
Jack
_______________________________________________
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>