Code Comments
Programming Forum and web based access to our favorite programming groups.Pete Dashwood wrote: > When you open the form (in the OPEN event) > > move POW-TRUE to "SelectText" of [control name]... > > TABbing to it will show selected text, as will clicking on it. > > It is not advisable to set properties on GotFocus, because the act of > setting them can raise another GotFocus event and this gets queued, > with unpredictable results, under certain (admittedly rare) > circumstances. I make it a practice to set all properties BEFORE I > activate the control, and I don't usually rely on the default > properties to be intact. But doesn't setting the properties (under admittedly rare) circumstances raise the GotFocus event? > > I would put the line of code above as the last statement in the RETURN > event, as well as in the Form OPEN. > > HTH, > > Pete. Thanks for the advice. 1. SelectText defaults to TRUE. 2. For a Text Box, SelectText can only be referenced (not set) at execution time. 3. Testing the SelectText property shows that it is true. You're right about the control going a little silly. If nothing but reading the contents takes place in the GotFocus control, the SelectText doesn't wink off. Moving something to the control in the GotFocus event (or changing the RenderText sub-property) turns off the text selection. I need a PreGotFocus event.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.