Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with CTRL+Y!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Help with CTRL+Y!
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01015284
Message ID:
01015284
Vues:
66
Within our system, CTRL+Y will wipe out any text in a textbox to the right of the cursor. From what I understand, this is VFP defined behaviour and not something that we added.

I'm trying to add a right click popup menu to our textbox class that offers cut, copy, paste and clear options. I want to make the clear option work like the CTRL+Y in that it will only clear what is to the right of the cursor.

I did this initially:
lnBar = bar()
do case
   ...
   case lnBar = 8      && Clear Option
      keyboard '{CTRL+Y}'
endcase
But that did not seem to work.

I tried this next:
lnBar = bar()
do case
   ...
   case lnBar = 8     && Clear Option
      * toControl is the control on which the right click occured
      lnSaveStart = toControl.SelStart 
      toControl.Value = left(toControl.Text,toControl.SelStart)
      toControl.SelStart = lnSaveStart
endcase
This worked fine for text values but gave me problems for numeric or date values (which makes sense considering my code). This had the added problem of converting my date or numeric values into text.

I could definitely add a case statement to try to handle different data types differently but I'm wondering if there is some easier way to handle this.

Any ideas? Thanks in advance!

Rodd
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform