Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit a Memo field using Ctrl+C, Ctrl+V, Ctrl+Z, Ctrl+Y (MODI MEMO) 3

Status
Not open for further replies.

dantheinfoman

Programmer
May 5, 2015
131
US
Hi All,

I'm working with some buttons that call a memo field to be edited, but the guys at the office HATE the fact that when they press Ctrl+C or Ctrl+V it erases what they'd highlighted and put some hideous symbol there. I don't know what to do. Here's the commandbutton that calls the memo edit:

Code:
MODI MEMO (this.r_cfieldname) NOMENU

Here's what it looks like:
Screen_Shot_06-12-15_at_11.11_PM_me8gox.png


then I highlight the word 'LALA'
Screen_Shot_06-12-15_at_11.13_PM_mkq0f4.png

and when I press Ctrl+C it looks like this:
Screen_Shot_06-12-15_at_11.13_PM_001_q2egfu.png


As always, I appreciate this forum so much, you are all a bunch of geniuses!!

Dan
 
I don't blame the guys at the office. I would hate it too.

The answer is that you need an Edit menu. The users won't have to use the Edit menu in order to cut and paste. They will be able to use Ctrl+C, etc. But the menu must exist.

If you already have a pull-down menu at the top of the screen in your applicatoin, add an Edit pad to it, and populate it with the standard commands: Cut, Copy, Paste, Select All, etc. The menu generator has a facility for doing this. If you are not using pull-down menus in your application, create an Edit menu anyway, but don't make it visible.

Another option (which I prefer) is to create a shortcut menu (again, the menu designer lets you do this). Add the above Edit commands, and then activate the menu from the right-click of you edit boxes. Not only will that solve the problem you described, but it will also provide an additional mechanism for cutting, pasting, etc. that your users will appreciate.

If you don't know how to use the menu generator, read the relevant pages in the help file, and come back with any specific questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike!

I've created an Edit box in a form that I want to call the memo to. It now can do Ctrl+C Ctrl+V etc built into it!

But I don't know how to get the MEMO into the form parameters.

Here's what I've got so far when the button calls the new memoform (SYMEMO.SCX):

Code:
STORE this.r_cfieldname TO mymemo
WAIT WINDOW &mymemo
WAIT WINDOW mymemo
WAIT WINDOW EVALUATE(mymemo)
*!*	WAIT WINDOW (this.r_cfieldname)
*!*	WAIT WINDOW this.r_cfieldname
*!*	WAIT WINDOW &this.r_cfieldname
DO FORM symemo WITH (this.r_cfieldname),this.r_cfieldname &&give the name of the field and the current value of the field as well to populate the TBox

and it always just says this in the wait window 'prprspct.persnnotes' and my form looks stupid because here's what ends up in the notes:
Screen_Shot_06-13-15_at_02.54_AM_doxueq.png


. . but I'm on the right track. I'm sure it's a syntax thing.

Please advise if you get time. and thanks for being awesome!!!

Dan
 
Thanks tbleken, can't wait to try adding those neat features like Ctrl+F for FIND. Wow, this is great, much appreciated.

Anybody know how to call up the value of the memo field prprspct.persnnotes into a form? such as DO FORM symenu with prprspct.persnnotes <<<this part won't work.

Thanks!
Dan
 
This is no problem. Instead of passing [tt]this.r_cfieldname[/tt] to the form, you need to pass [tt]this.r_cfieldname.value[/tt]. You'll find that will do what you want.

For what it's worth, I have the same kind of generic memo editing form in my own applications. The users generally like it. I've also made it resizable, and let the user change the font size.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike, thanks for your insight, but this.r_cfieldname is a property of the commandbutton, so it doesn't have a value. This happened when I tried the .VALUE.

**Program Error
Unknown member R_CFIELDNAME

Thanks though, I know I'm almost there!

Dan
 
Editboxes show memo field contents, so what is really the problem to set up an editbox with the memo field as its controlsource?
The culprit of your MODI MEMO ... NOMENU is, it a) generates an extra window you normally don't really want and it b) disables the menu this memo window typically has.
So one easy thing you may try is simply call MODI MEMO (this.r_cfieldname)

If you want to continue using your own memo edit form, also pass in (this.r_cfieldname), which contains the memo field name, obviously. Let that form run in the Default Datasession, not in a private datasession, and simply set the editbox controlsource to the passed in memo name. Ready to go.

Bye, Olaf.
 
Dear Olaf,

Controlsource for the WIN! I thank you once again for being brilliant and sharing your wealth of insight with us.

Thanks sooooooo much.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top