I assume you're launching the search form from one of the textbox events. If
that is the case, the event should have a "sender" parameter that could be
passed to the search form if you need the textbox in that form. You could
have a public property in the search form and a private variable that holds a
reference to your textbox.
If you're querying a database and returning the results to the textbox, you
probably don't even need to pass the textbox to the search form unless you
use the textbox for some other reason in the search form. All you should have
to do is show the search form using the ShowDialog method and then use the
results returned from your query after you return from showing the search
form. The search form would then need to have a public property to pass back
the query results.
Hope this helps.
"Materialised" wrote:
"Materialised" <ma**********@privacy.net> wrote in message
news:3u*************@individual.net... Hi All,
I have a problem.
I have multiple text boxes on one form. When the user clicks in any of
these text boxes, another (search) form opens which queries a database and
returns the search results to the textbox.
Now as I said I have multiple shared textboxes on the first form. I need
to know a why I can pass to my search form which textbox in perticular
called the search window.
Does anyone know of a way to achieve this?
I am using VB.Net 2003.
Many Thanks
Sorry I also did mean to mention I know I can do this using a public
variable. But I am looking for a better way.
Thanks