发信人: lofe ()感激生活(), 信区: BorlandDev
标 题: .在Memo的编辑过程中实现“Undo”
发信站: 哈工大紫丁香 (Mon Sep 4 16:13:36 2000), 转信
Doing an UnDo in a Memo Field:
If you have a pop-up menu in a TMemo, and put shortcuts
on it for the Cut,Copy, Paste, then you can handle those
events, and call CuttoClipBoard, CopytoClipBoard, etc.
However, if you put an Undo option onto your pop-up menu
(normally Ctrl-Z) how do you instruct the TMemo to do the Undo?
If the built-in undo is sufficient, you can get it easier than
a Ctrl+Z:
Memo1.Perform(EM_UNDO, 0, 0);
To check whether undo is available so as to enable/disable
an undo menu item:
Undo1.Enabled := Memo1.Perform(EM_CANUNDO, 0, 0) <> 0;
--
※ 修改:.haojs 于 Sep 4 16:11:12 修改本文.[FROM: bbs.hit.edu.cn]
--
※ 转寄:.武汉白云黄鹤站 bbs.whnet.edu.cn.[FROM: bbs.hit.edu.cn]
--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: haojs.bbs@bbs.whnet.]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:4.045毫秒