Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo field suggestions for selecting text
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01144778
Message ID:
01146601
Vues:
17
Barbara

Thanks for the confirmation.

Cyril


>I do see the same behavior as you. It seems to be that SelStart isn't set properly if you've just added text. I haven't figured out a workaround yet, but I'll let you know if I do.
>
>>I am having a problem with memo fields. I am trying to select the text from the current mouse position to the end. None of the suggestions that have been made have solved it. I am posting again hoping that someone has a way to solve it.
>>
>>Run the prg below. Click somewhere in the middle of the word "other", then click the button. Notice that everything from where you were to the end is selected correctly.
>>
>>Now at the end of "other" press enter twice. Then type "apple red".
>>
>>Now click between the two p's in apple, then click the button.
>>
>>I am expecting the text from p to the end to be selected, but I observe something different. Do you see the unexpected outcome also?
>>
>>Any ideas on how to fix this (vfp7).
>>
>>
>>Public oform1
>>
>>oform1=Newobject("form1")
>>oform1.Show
>>Return
>>
>>Define Class form1 As Form
>>
>>	Height = 525
>>	Width = 630
>>	DoCreate = .T.
>>	Caption = "Form1"
>>	Name = "Form1"
>>
>>
>>	Add Object edit1 As EditBox With ;
>>		Height = 210, ;
>>		HideSelection = .F., ;
>>		Left = 78, ;
>>		Top = 127, ;
>>		Width = 261, ;
>>		ControlSource = "tt.mm", ;
>>		Name = "Edit1"
>>
>>
>>	Add Object command1 As CommandButton With ;
>>		Top = 49, ;
>>		Left = 85, ;
>>		Height = 27, ;
>>		Width = 84, ;
>>		Caption = "Command1", ;
>>		Name = "Command1"
>>
>>
>>	Procedure Load
>>	Create Cursor tt (mm Memo)
>>	Append Blank
>>	Replace mm With "some text"+Chr(13)+"other"
>>Endproc
>>
>>
>>	Procedure command1.Click
>>	With Thisform.edit1
>>		nStart = .SelStart
>>		nEnd = Len(.Value)
>>
>>		.SelStart = nStart
>>		.SelLength = nEnd - nStart
>>		.SetFocus()
>>	Endwith
>>Endproc
>>
>>
>>Enddefine
>>
>>
>>Cyril
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform