| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: How to Pass Object in |
and this is why I posted the original question. I couldn't use
ActiveControl, because the user is entering data in a Tablet PC, where
they are writing their inputs in a FRAME, then when they hit the
COMMAND button, it converts and puts the text into the last textbox
clicked. For example, one of the screens (this is a fairly large
application that has about 40 forms, with some of these forms having
up to 5 screens using tabs) has about 20 text box entry fields. The
user clicks the box that they want text entered (currently my active
control), then they write on a "scratch pad area" (which then becomes
the active control), then they click a cmd button (now the active
control) to send the convert written text to that textbox. So to get
around that, when the user clicks the textbox, i set a variable called
sWhichBoxSelected to the name of the control (just a string variable).
So after the user selects the SEND cmd button, I check the variable,
make that box the active control, and do some processing (highlight
background, update the text, etc).
So I guess the follow on question is, is there a way to actually pass
this variable as the name of the active control, rather than having to
actually pass the name of the textbox (which would eliminate my need
to write a case statement to reset the active control, dependent on
what is in the sWhichBoxSelected variable, instead just say
sWhichBoxSelected IS the active control).
In other words, instead of doing this:
.
.
CallMyFunction (Text1) 'if this was the actual name of the
control
.
.
Can I do this:
.
.
CallMyFunction (sWhichBoxSelected) 'where the var contains the
name of
. 'control
.
and have the CallMyFunction know that I want all the processing to be
done to the correct object.
Right now to do this, I have to do something like this:
Select Case sWhichBox
Case "txtAddress"
txtAddress.SelText = myInkCollector.Ink.Strokes.ToString
Case "txtCity"
txtCity.SelText = myInkCollector.Ink.Strokes.ToString
Case "txtApproverName"
txtApproverName.SelText = myInkCollector.Ink.Strokes.ToString
.
.
It would be nicer if I could just do it once.
thanks again for the help,
John
"Larry Serflaten" wrote in message
news:...
> "Rick Rothstein" wrote
> > > VB keeps track of the current control that has the focus in a
> > > variable called ActiveControl. That is simialr to what you want
> > > to do.
> >
> > To be more precise, ActiveControl is a property.
>
> I didn't go into fine detail. I was using that as an example of how
> MS solved the problem of knowing which control the user is
> inputting text into. Maybe it wasn't the best example, but it
> was 'simialr' (sic!)
>
>
> LFS
>
>
>
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com
---
* RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
* RgateImp.MoonDog.BBS at 2/24/04 11:44:49 AM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)SEEN-BY: 633/267 270 @PATH: 278/230 10/345 106/1 2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.