Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with CTRL+Y!
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015284
Message ID:
01016161
Views:
11
Thanks Sergey! That seemed to do it. The only thing I noticed is that it acts differently with date fields. If I'm sitting in the middle of a date field and press CTRL+Y, everything to the right of the cursor will be wiped but the leftmost characters of the date will be left.

With the fix you provided, the entire date is wiped out regardless of where the cursor is positioned. Any ideas why that may be?

Thanks again for your help.

Rodd

>>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,
>
>Try
...
>keyboard '{CTRL+Y}' CLEAR
>DOEVENT
>...
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform