Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to remove a selected line from an editbox?
Message
From
07/05/2002 10:55:08
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00653471
Message ID:
00653525
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I have an editbox on a form. The editbox is tied to a Memo field. The editbox contains a list of names. I made a command button called Delete that is going to be used to remove a selected name from the editbox.
>
>What's the best way to do this? How can I identify the line that the user wants to remove from the editbox and then remove it? Use a line number? SelText? Can I set it up so that the user clicks on a line and the whole line gets selected automatically? And then when the user presses Delete button the line disappears and all the other names move up one position.
>
>Any help is very much appreciated.
>
>My Add button to add a name to the editbox works great. My Delete button does not.

Provided the values of .selstart and .sellength in your editbox are set properly, you can pretty much do this:
with oTheEditBox
   .value=stuff(.value, .selstart, .sellength, "")
endwith
You'd be better off with a listbox, though - it's selectable using a single click. You could use an array (property) to populate it from the memo using alines(), and later save the values back into the memo concatenating array values delimited by chr(13). The downside would be that you'd have to have a textbox to add values.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform