|
Home > Archive > FoxPro Help and Support > May 2005 > choose a specific object in the tab order
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
choose a specific object in the tab order
|
|
| Piddepadde 2005-05-07, 7:24 am |
| Hi,
If I have (four example) four textboxes, in a form, with the tab order 1-4.
Is there any command to place the cursor in the third textbox.
I have tried to change the taborder with:
thisform.textbox3.tabindex=1
But it does not work as planned....
/Patrik
| |
| Stefan Wuebbe 2005-05-07, 7:24 am |
|
"Piddepadde" < Piddepadde@discussio
ns.microsoft.com> schrieb im Newsbeitrag
news:01EA363E-3A98-4E80-A476- F63EA4B2750B@microso
ft.com...
> Hi,
>
> If I have (four example) four textboxes, in a form, with the tab order 1-4.
> Is there any command to place the cursor in the third textbox.
You can use the third textbox.SetFocus() method.
Or for example in firstTextbox.Valid() return a numeric value
Return 2 && or "Return -2"
Or, since Vfp9, you can also
Return Thisform.Textbox3
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| Piddepadde 2005-05-07, 9:24 am |
| Thanks Stefan,
the setfocus command worked well..
but the return thisform.textbox3 did not work..?
I assume that one have to thisform.refresh before you can see the
selection ??
/Patrik
"Stefan Wuebbe" wrote:
>
> "Piddepadde" < Piddepadde@discussio
ns.microsoft.com> schrieb im Newsbeitrag
> news:01EA363E-3A98-4E80-A476- F63EA4B2750B@microso
ft.com...
>
> You can use the third textbox.SetFocus() method.
> Or for example in firstTextbox.Valid() return a numeric value
> Return 2 && or "Return -2"
> Or, since Vfp9, you can also
> Return Thisform.Textbox3
>
>
> hth
> -Stefan
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
>
| |
| Stefan Wuebbe 2005-05-08, 3:23 am |
|
"Piddepadde" < Piddepadde@discussio
ns.microsoft.com> schrieb im Newsbeitrag
news:523EDF4A-13C4-4B28-B5EE- 2A20FAA6952D@microso
ft.com...
> Thanks Stefan,
> the setfocus command worked well..
> but the return thisform.textbox3 did not work..?
> I assume that one have to thisform.refresh before you can see the
> selection ??
Hi Patrik,
It depends from where you want to set the focus.
"return thisform.textbox3" works only in anyControl.Valid() in VFP9.
In Vfp8 it would not work as expected but keep the focus where it was.
On the other hand, when your code is in anyControl.LostFocus() or in
a commandButton.Click(), you can use "textbox3.SetFocus() only, which
in turn would not be allowed in a Valid() method.
Does that help?
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| Anders Altberg 2005-05-08, 1:23 pm |
| RETURN <object.name< only works from the Valid event of another object. It
was introduced in VFP8. Calling Object.SetFocus() is not allowed from the
Valid event.
-Anders
"Piddepadde" < Piddepadde@discussio
ns.microsoft.com> wrote in message
news:523EDF4A-13C4-4B28-B5EE- 2A20FAA6952D@microso
ft.com...[color=darkred]
> Thanks Stefan,
> the setfocus command worked well..
> but the return thisform.textbox3 did not work..?
> I assume that one have to thisform.refresh before you can see the
> selection ??
>
> /Patrik
>
> "Stefan Wuebbe" wrote:
>
Newsbeitrag[color=da
rkred]
order 1-4.[color=darkred]
|
|
|
|
|