Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Editbox.seltext=a+editbox.seltext+b
Message
De
12/02/2005 16:21:39
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Editbox.seltext=a+editbox.seltext+b
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
00986338
Message ID:
00986338
Vues:
80
J'aime (1)
Here's a bit of code I have tried to run in several events of a button - tried when (with .lostfocus and .setfocus commented out), click, gotfocus, even valid (without nodefault), and the results vary.
With this.Parent.edtbox1
	.SelText="{"+Alltrim(.SelText)+"}"
*!*	 	.lostfocus
*!*	 	.setfocus
endwith
nodefault
Originally, this code worked fine without the nodefault and in button.click, but I've noticed that the text cursor (i.e. the insertion point bar) vanishes after this code executes. The code is supposed to surround the selected text in the editbox with curly braces. The user selects the text, clicks the button and that's it... except that he now needs to keep mouse down on the editbox (or also on any other textbox) to see where the next character typed will come up.

So I tried to move the code elsewhere, but then the editbox loses focus (ok with me) and its .selstart and .sellength revert to zero (why!?) and the curly braces are inserted at the beginning of text. If I put the code back to button's click, I lose cursor.

Did anyone see something like this, and is there some simple trick (a property of something somewhere?) that will fix this?

update: got it to work from button.when with return .f. instead of nodefault. The editbox loses focus, though, and (now this is funny) the pageframe gets it, even though the editbox isn't last in the tab order.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform