Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox property - Select on Entry
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00734203
Message ID:
00734497
Views:
32
Hi Marcia,

>but this way, the control cannot get the focus!? I think the only way to suppress VFP's default behaviour would be, not setting Format to "K" and setting SelectOnEntry=.F. Or am I totally on the wrong way?
>Sorry, but you are mistaken here. The default VFP behavior runs. It just runs beore the cutom code that sets the highlighting.
>Copy and past the code into the GotFocus() of a textbox and see for yourself < s >.

you're right! I didn't look at your code carefully enough and interpreted Textbox::GotFocus() as a comment where he should put that code. That was a stupid mistake in the middle of the night < s >. But I couldn't imagine you were posting code that doesn't work, so I was confused < g >. My code only works with with SelectOnEntry = .F. and yours regardless of the property setting.

Thanks for the clarification!
Armin
PUBLIC goForm

goForm = CREATEOBJECT("frmtest")
goForm.Show()

RETURN


**************************************************
*-- Class:        frmtest (c:\temp\test.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   12/19/02 04:28:06 PM
*
DEFINE CLASS frmtest AS form

	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT text1 AS textbox WITH ;
		Value = ("My Text           "), ;
		Height = 23, ;
		Left = 72, ;
		Top = 36, ;
		Width = 100, ;
		Name = "Text1"


	ADD OBJECT text2 AS textbox WITH ;
		Value = ("My Text    "), ;
		Height = 23, ;
		Left = 72, ;
		SelectOnEntry = .T., ;
		Top = 84, ;
		Width = 100, ;
		Name = "Text2"


	PROCEDURE text1.GotFocus
		*-- Armin's version works only great, 
		*-- with SelectOnEntry = .F. <g>
		THIS.SelStart = 0
		THIS.SelLength = LEN(THIS.Text)
	ENDPROC


	PROCEDURE text2.GotFocus
		*-- Marcia's version works great, even
		*-- with SelectOnEntry = .T. :))
		Textbox::GotFocus()
		THIS.SelStart = 0
		THIS.SelLength = LEN(THIS.Text)
		NODEFAULT
	ENDPROC


ENDDEFINE
*
*-- EndDefine: frmtest
**************************************************

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform