如何从代码中复制带有按钮的对话框中输入的文本? [英] How to copy the entered text in dialog with button from code?

查看:66
本文介绍了如何从代码中复制带有按钮的对话框中输入的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击按钮后,我想从代码中复制剪贴板对话框中的文本.

I want to copy the text in DialogBox in my clipboard from code after button click.

我需要在对话框中使用功能ctrl + c的按钮.

I need in my dialog a button with function ctrl+c .

我的对话框使用了以下代码:

Dialog      dialog;
DialogField dialogField;
str string;
;
dialog = new Dialog("My personal dialog");
dialogField= dialog.addFieldvalue(extendedTypeStr(String30), string, "insert the text to be copied");

// ctrl + c button
//I need a button  with the function to copy the text entered
dialog.run();
if (dialog.closedOk())
{
}
}

感谢您的帮助,

享受!

推荐答案

检查示例用法:

TextBuffer txtb = new textBuffer(); 
#define.ExampleFile(@"c:\test.txt") 
#define.ExampleOpenMode("w") 

// Set code access permission to help protect the use of TextBuffer.tofile 
new FileIoPermission(#ExampleFile, #ExampleOpenMode).assert(); 

if ( txtb.fromClipboard() ) 
{ 
    // Got text from clipboard - save it to file 
    txtb.toFile(#ExampleFile); 
} 

// Close the code access permission scope. 
CodeAccessPermission::revertAssert(); 

应该很容易适应对话框.

It should be easy to adapt to a dialog.

这篇关于如何从代码中复制带有按钮的对话框中输入的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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