怎么做Ctrl + Z?

编程入门 行业动态 更新时间:2024-10-24 04:31:26
本文介绍了怎么做Ctrl + Z?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在VB中,你可以复制到剪贴板......然后从剪贴板粘贴。 我想做的是做一个CTRL + Z到做和''撤消''。 例如,如果您在Combobox1中有一些日期并将其复制到剪贴板。你可以将粘贴到Combobox2上。但是在Combobox2中,你可以(通过键盘) CTRL + Z并撤消粘贴。 你怎么能在VB中工作? 谢谢 布鲁斯

解决方案

嗨布鲁斯, 撤消和重做需要一个上下文。 ComboBoxes和TextBoxes等 - 它们都是 有一个Undo因为可编辑的控件可以做那种事情。 你希望你的撤销/重做是什么工作的与? 最常见的答案是你必须在操作之前保存某些东西的状态,并在请求撤消时交换状态。 (交换 - 以便撤消 可以撤消撤消)。多次撤消需要管理一堆Undo 州。 问候, Fergus

* B先生< Us ** @ NoWhere.Com> scripsit:

在VB中,你可以复制到剪贴板......然后从剪贴板粘贴。 我想做的是做一个CTRL + Z来做和''撤消''。 例如,如果您在Combobox1中有一些日期并将其复制到剪贴板。然后你可以将它粘贴到Combobox2。但是在Combobox2中,你可以(通过键盘) CTRL + Z并撤消粘贴。

在你自己的控制下?以你自己的形式?您可以使用 theshowtcuts定义菜单,例如: < www.mvps/dotnet/dotnet/samples/controls /downloads/RichTextBoxContext.zip> - Herfried K. Wagner MVP·VB Classic,VB.NET < www.mvps/dotnet>

使用Deft Fingers,Fergus Cooney <音响**** @ post>写道:

嗨布鲁斯, Hullo Fergus。 你希望你的撤销/重做是什么工作的用? 我在原帖中提到过它。但是又来了: 你有一个带有一些Text的Combobox1。用户将其剪切并粘贴到第二个 Combobox(2)中。然后他们想......嗯......不想那样做。所以''撤消'' 会很好。 现在......你可以通过键盘手动撤销(CTRL + Z)。这是 真的只不过你在Windows中可以做的标准CTRL + Z(即: 在文件资源管理器中删除文件...按CTRL + Z和它将从 Trashcan恢复。 最常见的答案是你必须在操作之前保存某些东西的状态并在撤消时交换状态请求。 (交换 - 以便撤消可以撤消撤消)。多次撤消需要管理一堆撤销

是的。我只是希望有一种更简单的方法。没什么大不了。对我的应用程序来说不是很重要... ...只是一个想法。 谢谢! Bruce

In VB, you can Copy to Clipboard... and then Paste from Clipboard. What I''d like to do is to do a CTRL + Z to do and ''undo''. For example, if you have some date in Combobox1 and Copy it to Clipboard. You can then Paste it to Combobox2. But in Combobox2, you can (via keyboard) CTRL+Z and undo the paste. How can you in VB? Thanks Bruce

解决方案

Hi Bruce, Undo and Redo need a context. ComboBoxes and TextBoxes, etc - they all have an Undo because editable controls do that kind of thing. What do you want your Undo/Redo to work with? The most general answer is that you must save the state of something before an operation and swap the states when Undo is requested. (Swap - so that Undo can undo the Undo). Multiple Undo requires the management of a stack of Undo states. Regards, Fergus

* Mr. B <Us**@NoWhere.Com> scripsit:

In VB, you can Copy to Clipboard... and then Paste from Clipboard. What I''d like to do is to do a CTRL + Z to do and ''undo''. For example, if you have some date in Combobox1 and Copy it to Clipboard. You can then Paste it to Combobox2. But in Combobox2, you can (via keyboard) CTRL+Z and undo the paste.

In your own control? In your own form? You can define a menu with theshowtcuts, like in: <www.mvps/dotnet/dotnet/samples/controls/downloads/RichTextBoxContext.zip> -- Herfried K. Wagner MVP · VB Classic, VB.NET <www.mvps/dotnet>

With Deft Fingers, "Fergus Cooney" <fi****@post> wrote:

Hi Bruce, Hullo Fergus. What do you want your Undo/Redo to work with? I sort of mentioned it in my original post. But here it is again: You have a Combobox1 with some Text. A user cuts and pastes it into a 2nd Combobox (2). Then they think.. hmmm... don''t want to do that. So an ''undo'' would be nice. Now... you can do the undo manually via the keyboard (CTRL+Z). Which is really nothing more than the standard CTRL+Z that you can do in Windows (ie: delete a file in File Explorer... press CTRL+Z and it will be restored from Trashcan). The most general answer is that you must save the state of something beforean operation and swap the states when Undo is requested. (Swap - so that Undocan undo the Undo). Multiple Undo requires the management of a stack of Undo

Yeah. I was just hoping that an easier way was available. No big deal. Not critical for my app... just was a thought. Thanks! Bruce

更多推荐

怎么做Ctrl + Z?

本文发布于:2023-10-26 09:36:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529781.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:怎么做   Ctrl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!