Ahsan Amin


when i enter something in the text box the cursor automatically moves to next record ater entering 30 characters. I have not set it's lenth. so what's the reason




Re: textbox length

Naomi Nosonovsky


Is the textbox bound (what is its ControlSource) Is MaxLength property of the textbox set






Re: textbox length

dni

May be you have a "skip" after 30 characters in one of the methods or in properties.







Re: textbox length

Ahsan Amin

Niether textbox is bound nor maxlength property is set.





Re: textbox length

Naomi Nosonovsky

Hmm, is it a default VFP textbox or a class What is InputMask property for the textbox

Put messagebox(this.InputMask) in textbox.GotFocus event to see it.





Re: textbox length

Christof Wollenhaupt

If you don't specify a ControlSource, nor an InputMask or a MaxLength value, then VFP uses the textbox width and the average character width to calculate the maximum number of characters you can enter into a textbox. If you want more than 30 characters you have to specify an InputMask or set MaxLength.





Re: textbox length

Naomi Nosonovsky

Christof Wollenhaupt wrote:
If you don't specify a ControlSource, nor an InputMask or a MaxLength value, then VFP uses the textbox width and the average character width to calculate the maximum number of characters you can enter into a textbox. If you want more than 30 characters you have to specify an InputMask or set MaxLength.

Interesting, thanks.





Re: textbox length

dni

....how do you explain skip






Re: textbox length

Vladimir Zografski

Hi Christof,
Thank you!
This is new knowledge for me.
Good example

Code Snippet

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 07/31/07 10:33:12 PM
*
DEFINE CLASS form1 AS form


DoCreate = .T.
Caption = "Form1"
Name = "Form1"


ADD OBJECT text1 AS textbox WITH ;
Height = 25, ;
Left = 1, ;
Top = 21, ;
Width = 86, ;
Name = "Text1"


ADD OBJECT text2 AS textbox WITH ;
Height = 28, ;
Left = 1, ;
Top = 62, ;
Width = 100, ;
Name = "Text2"


ADD OBJECT text3 AS textbox WITH ;
Height = 26, ;
Left = 1, ;
Top = 100, ;
Width = 365, ;
Name = "Text3"


ADD OBJECT command1 AS commandbutton WITH ;
Top = 154, ;
Left = 114, ;
Height = 23, ;
Width = 135, ;
Caption = "display max length", ;
Name = "Command1"


ADD OBJECT label1 AS label WITH ;
Caption = "", ;
Height = 27, ;
Left = 31, ;
Top = 195, ;
Width = 300, ;
Name = "Label1"


PROCEDURE command1.Click
ThisForm.Label1.Caption = [Text1: ]+TRANSFORM(LEN(Thisform.Text1.Value))+[ ]+;
[Text2: ]+TRANSFORM(LEN(Thisform.Text2.Value))+[ ]+;
[Text3: ]+TRANSFORM(LEN(Thisform.Text3.Value))
ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************







Re: textbox length

Naomi Nosonovsky

SET CONFIRM controls if the 'skip' is going to occur or not.





Re: textbox length

PB_UK

My understanding of "set confirm on" is that it is scoped to the current data session. However, I have placed a "set confirm on" command in the "Init" method of a number of forms I have created that run in private data sessions and it doesn't work fully - I can no longer type out of an input into the next one, but I can still delete back into a previous one. Not ideal.

Cheers