怎么做Ctrl + Z? [英] How to do Ctrl + Z?

查看:154
本文介绍了怎么做Ctrl + Z?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.net中,你可以复制到剪贴板......然后从剪贴板粘贴。


我想做的是做一个CTRL + Z到做和''撤消''。


例如,如果您在Combobox1中有一些日期并将其复制到剪贴板。你可以将
粘贴到Combobox2上。但是在Combobox2中,你可以(通过键盘)

CTRL + Z并撤消粘贴。


你怎么能在VB.net中工作?


谢谢


布鲁斯

解决方案

嗨布鲁斯,


撤消和重做需要一个上下文。 ComboBoxes和TextBoxes等 - 它们都是

有一个Undo因为可编辑的控件可以做那种事情。


你希望你的撤销/重做是什么工作的与?


最常见的答案是你必须在操作之前保存某些东西的状态,并在请求撤消时交换状态。 (交换 - 以便撤消

可以撤消撤消)。多次撤消需要管理一堆Undo

州。


问候,

Fergus


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

在VB.net中,你可以复制到剪贴板......然后从剪贴板粘贴。

我想做的是做一个CTRL + Z来做和''撤消''。

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




在你自己的控制下?以你自己的形式?您可以使用

theshowtcuts定义菜单,例如:


< http://www.mvps.org/dotnet/dotnet/samples/controls /downloads/RichTextBoxContext.zip>


-

Herfried K. Wagner

MVP·VB Classic,VB.NET

< http://www.mvps.org/dotnet>


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

嗨布鲁斯,


Hullo Fergus。

你希望你的撤销/重做是什么工作的用?


我在原帖中提到过它。但是又来了:


你有一个带有一些Text的Combobox1。用户将其剪切并粘贴到第二个

Combobox(2)中。然后他们想......嗯......不想那样做。所以''撤消''

会很好。


现在......你可以通过键盘手动撤销(CTRL + Z)。这是

真的只不过你在Windows中可以做的标准CTRL + Z(即:

在文件资源管理器中删除文件...按CTRL + Z和它将从

Trashcan恢复。

最常见的答案是你必须在操作之前保存某些东西的状态并在撤消时交换状态请求。 (交换 - 以便撤消
可以撤消撤消)。多次撤消需要管理一堆撤销




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


谢谢!


Bruce


In VB.net, 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.net?

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.net, 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:

<http://www.mvps.org/dotnet/dotnet/samples/controls/downloads/RichTextBoxContext.zip>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>


With Deft Fingers, "Fergus Cooney" <fi****@post.com> 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 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



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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆