Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: highlight the cursor position

Geek News

highlight the cursor position
Gator 12/16/2008 3:25:00 PM
is there a way to highlight the position of the cursor....for example if the
cursor is in a textbox, the textbox background would change to a certain
color. Now, if there are, say, 30 controls on the form, is there a way in
program to highlight where the cursor is. If the button has the focus it is
blue, if the textbox has focus it is blue or if the subform has focus it is
blue... I don't think I want to code each control for focus.....is there
some code to use that will check where the focus is and change the property,
like the background color?
RE: highlight the cursor position
Maurice 12/16/2008 7:38:03 PM
What I always use is the conditional formatting for this option. Select all
the controls and choose conditional formatting. In the condition choose for
"when field has focus". Choose an appropropriate background color (Yellow is
a good choice) and voila.

Test is out by tabbing thtough the different controls and you'll see that
the field that has focus will change the backgrounf color of the field.

A well appreciated feature by the end-users.

hth
--
Maurice Ausum


"Gator" wrote:

[Quoted Text]
> is there a way to highlight the position of the cursor....for example if the
> cursor is in a textbox, the textbox background would change to a certain
> color. Now, if there are, say, 30 controls on the form, is there a way in
> program to highlight where the cursor is. If the button has the focus it is
> blue, if the textbox has focus it is blue or if the subform has focus it is
> blue... I don't think I want to code each control for focus.....is there
> some code to use that will check where the focus is and change the property,
> like the background color?
Re: highlight the cursor position
Marshall Barton <marshbarton[ at ]wowway.com> 12/16/2008 8:14:04 PM
Gator wrote:

[Quoted Text]
>is there a way to highlight the position of the cursor....for example if the
>cursor is in a textbox, the textbox background would change to a certain
>color. Now, if there are, say, 30 controls on the form, is there a way in
>program to highlight where the cursor is. If the button has the focus it is
>blue, if the textbox has focus it is blue or if the subform has focus it is
>blue... I don't think I want to code each control for focus.....is there
>some code to use that will check where the focus is and change the property,
>like the background color?


For Text and Combo boxes, you can just use Conditional
Formatting (Format menu) with the Has Focus option.

Other controls, (e.g. buttons) not only have no formatting,
but you can not change their back color. What I've done for
these controls is put a label control behind the button (so
it shows around the edges and use the button's GotFocus
event to change the label's back color and LostFocus to
change it back.

Setting a subform's color (actually each of its sections)
too doesn't make a lot of sense because you would not be
able to highlight the control in the subform (unless you use
another color and make your form's look like Christmas
trees).

--
Marsh
MVP [MS Access]
RE: highlight the cursor position
Gator 12/16/2008 8:24:01 PM
what does "you must specify criterai for all conditional formats" mean?

"Maurice" wrote:

[Quoted Text]
> What I always use is the conditional formatting for this option. Select all
> the controls and choose conditional formatting. In the condition choose for
> "when field has focus". Choose an appropropriate background color (Yellow is
> a good choice) and voila.
>
> Test is out by tabbing thtough the different controls and you'll see that
> the field that has focus will change the backgrounf color of the field.
>
> A well appreciated feature by the end-users.
>
> hth
> --
> Maurice Ausum
>
>
> "Gator" wrote:
>
> > is there a way to highlight the position of the cursor....for example if the
> > cursor is in a textbox, the textbox background would change to a certain
> > color. Now, if there are, say, 30 controls on the form, is there a way in
> > program to highlight where the cursor is. If the button has the focus it is
> > blue, if the textbox has focus it is blue or if the subform has focus it is
> > blue... I don't think I want to code each control for focus.....is there
> > some code to use that will check where the focus is and change the property,
> > like the background color?
Re: highlight the cursor position
Gator 12/16/2008 9:04:02 PM
it works now. I don't know what I was doing to cause that message. I might
have unknowingly selected a control that did not allow that format...thanks

"Marshall Barton" wrote:

[Quoted Text]
> Gator wrote:
>
> >is there a way to highlight the position of the cursor....for example if the
> >cursor is in a textbox, the textbox background would change to a certain
> >color. Now, if there are, say, 30 controls on the form, is there a way in
> >program to highlight where the cursor is. If the button has the focus it is
> >blue, if the textbox has focus it is blue or if the subform has focus it is
> >blue... I don't think I want to code each control for focus.....is there
> >some code to use that will check where the focus is and change the property,
> >like the background color?
>
>
> For Text and Combo boxes, you can just use Conditional
> Formatting (Format menu) with the Has Focus option.
>
> Other controls, (e.g. buttons) not only have no formatting,
> but you can not change their back color. What I've done for
> these controls is put a label control behind the button (so
> it shows around the edges and use the button's GotFocus
> event to change the label's back color and LostFocus to
> change it back.
>
> Setting a subform's color (actually each of its sections)
> too doesn't make a lot of sense because you would not be
> able to highlight the control in the subform (unless you use
> another color and make your form's look like Christmas
> trees).
>
> --
> Marsh
> MVP [MS Access]
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net