Home All Groups Group Topic Archive Search About

Control with previous focus

Author
30 May 2005 11:18 PM
Dale
Hi, I have a textbox on my form along with several other textbox, labels
and buttons.  When the textbox of interest gets focus, how can I tell
which control had focus prior to it receiving focus?  Thanks.

Author
31 May 2005 1:05 AM
Bob Butler
"Dale" <dale0***@hotmail.com> wrote in message
news:%23QjTW3WZFHA.2420@TK2MSFTNGP12.phx.gbl
> Hi, I have a textbox on my form along with several other textbox,
> labels and buttons.  When the textbox of interest gets focus, how can
> I tell which control had focus prior to it receiving focus?  Thanks.

You'd have to keep track of that yourself.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
31 May 2005 8:39 AM
Jan Hyde
Dale <dale0***@hotmail.com>'s wild thoughts were released on
Mon, 30 May 2005 16:18:42 -0700 bearing the following fruit:

>Hi, I have a textbox on my form along with several other textbox, labels
>and buttons.  When the textbox of interest gets focus, how can I tell
>which control had focus prior to it receiving focus?  Thanks.

Just out of interest, why?



Jan Hyde (VB MVP)

--
Quantities : Many breasts (Jan Hyde)

[Abolish the TV Licence - http://www.tvlicensing.biz/]
Author
31 May 2005 4:09 PM
Dale
Hi Jan,

A customer wants some warning messages on a few spots on a data entry
screen depending on the previously focussed control in some cases.

Bob, I thought I'd have to check it myself.  Thanks.

Show quoteHide quote
> Dale <dale0***@hotmail.com>'s wild thoughts were released on
> Mon, 30 May 2005 16:18:42 -0700 bearing the following fruit:
>
>
>>Hi, I have a textbox on my form along with several other textbox, labels
>>and buttons.  When the textbox of interest gets focus, how can I tell
>>which control had focus prior to it receiving focus?  Thanks.
>
>
> Just out of interest, why?
>
>
>
> Jan Hyde (VB MVP)
>
Author
31 May 2005 4:16 PM
Bob Butler
"Dale" <dale0***@hotmail.com> wrote in message
news:Ox5MOsfZFHA.2884@tk2msftngp13.phx.gbl
> Hi Jan,
>
> A customer wants some warning messages on a few spots on a data entry
> screen depending on the previously focussed control in some cases.

You *may* be able to use the LostFocus and/or Validate events of the
"previously focused controls".   Watch out for menus, toolbar buttons and
'default' command buttons as they are notorious for bypassing sch code.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
31 May 2005 5:27 PM
Dale
Thanks Bob.  I was thinking of the LostFocus too, and I'll keep your
tips in mind.

Show quoteHide quote
> "Dale" <dale0***@hotmail.com> wrote in message
> news:Ox5MOsfZFHA.2884@tk2msftngp13.phx.gbl
>
>>Hi Jan,
>>
>>A customer wants some warning messages on a few spots on a data entry
>>screen depending on the previously focussed control in some cases.
>
>
> You *may* be able to use the LostFocus and/or Validate events of the
> "previously focused controls".   Watch out for menus, toolbar buttons and
> 'default' command buttons as they are notorious for bypassing sch code.
>