General information
Category:
Coding, syntax & commands
>I'm looking for an easy way for two textboxes to reference each other.
>Because of the nature of the form they are on it is ugly for them to try
>to reference using the common 'this.parent...' or 'this.form..' Instead I've
>been considering having a property on each of the textboxes called oRef. So,
>they could refer to each other by 'this.oRef.Value.' regardless of where in
>the form they appear. The obvious stumbling block to this is, of course, that
>a form that has any object references still intact won't release. I've tried
>to manually release the object reference in the destroy even of the textbox
>class, but the destory even doesn't even fire before the form hangs. Is there
>a better/easier way of doing this?
I don't really understand why you can't directly reference the objects . However, you could try adding a couple of properties to the form that store the names of the textboxes in question. Then in the code refencing the other box you can use a macro replacement
eg >
in the forms INIT code
Thisform.TextBox1Name="Thisform.TextBox2 ........etc " && whatever the initial name is called
Thisform.TextBox2Name="Thisform. ........etc "
Then in the code to execute :
bName=Thisform.TextBox2Name
with &bName
put the methods or properties associated with TextBox2 here
endwith
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only