Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ryss Unger
  Where is Ryss Unger?
 Cape Town
 South Africa
 Ryss Unger
 To: Dale Dedoroy
  Where is Dale Dedoroy?
 Bacolod City, Negros Occidental
 Philippines
 Dale Dedoroy
 Tags
Subject: RE: GotFocus setfocus trick
Thread ID: 470 Message ID: 504 # Views: 3 # Ratings: 0
Version: Visual FoxPro 6 Category: Classes and Objects
Date: Friday, June 01, 2001 4:07:00 PM         
   


> > > > > Thanks Eric. I will try that. I really appreciate all the help that you guys give me. I just
> > > > > want to say thanks again.
> > > >
> > > > Our buddy Eric left out the alltrim()
> > > >
> > > > without it, the fields that are actually longer or input mask is set to be longer are not selected correctly in the textbox. also it will look exactly like you tabbed to the field
> > > >
> > > > this.selstart = 0
> > > > this.sellength = LEN(alltrim(this.value))
> > > >
> > > >
> > > > Paul Culbertson
> > > >
> > > > Home of the Visual FoxPro Experts
> > > >
> > > > Houston, TX
> > > >
> > >
> > > Yeah you must put into consideration the data type of the value ur about to display...
> > >
> > > this.selstart = 0
> > > this.sellength = LEN(alltrim(this.value))
> > >
> > > use this code if the data type is alphanumeric
> > >
> > > this.selstart = 0
> > > this.sellength = len(this.inputmask)
> > >
> > > or simply
> > >
> > > this.selstart = 0
> > > this.sellength = len(this.width)
> > >
> > > when the data type is numeric...
> > >
> > > God Bless,
> > > Rommel
> >
> > Quick and dirty solution but more safe and sure. On the GotFocus event of the textbox:
> > Keyboard '{HOME}'+'{SHIFT+END}'
> >
> > This works even if you move from control to control using arrow keys.
> >
> > Hth,
> > Dale
Hi all,
You may want to try in the GotFous event
this.setfocus

I find it works well and numeric or character is of no consequence.

Works with click or tab. Works only when object gets focus for first time allowing user to click again to position curor at position other than at start.

Regards
Ryss

ENTIRE THREAD

Select on Entry Problem with VFP 6.0 Posted by Chris Counts @ 5/31/2001 8:50:28 AM
RE: Select on Entry Problem with VFP 6.0 Posted by Eric den Doop @ 5/31/2001 9:13:54 AM
RE: Select on Entry Problem with VFP 6.0 Posted by Chris Counts @ 5/31/2001 11:11:03 AM
RE: Select on Entry Problem with VFP 6.0 Posted by Paul Culbertson @ 5/31/2001 2:09:04 PM
RE: Select on Entry Problem with VFP 6.0 Posted by rommel santillan @ 5/31/2001 7:45:53 PM
RE: Select on Entry Problem with VFP 6.0 Posted by Dale Dedoroy @ 5/31/2001 9:29:09 PM
Erratum: I realized GotFocus should read Click event. Sorry. Posted by Dale Dedoroy @ 5/31/2001 9:34:35 PM
RE: GotFocus setfocus trick Posted by Ryss Unger @ 6/1/2001 4:07:00 PM
RE: Select on Entry Problem with VFP 6.0 Posted by Grigore Dolghin @ 6/2/2001 4:40:52 PM
What if the textbox is in a grid? Posted by Khalil Shaddad @ 1/9/2004 2:55:23 PM
RE: What if the textbox is in a grid? Posted by Travis Pick @ 1/9/2004 9:10:01 PM
RE: What if the textbox is in a grid? Posted by Khalil Shaddad @ 1/12/2004 7:54:09 AM