简体   繁体   中英

How to copy text from a messageBox in Visual Basic / VB.NET

How can I copy text from a messageBox in Visual Basic?

I know I could just do Ctr+C and it would copy the text, the problem with this technique is that it copies the title and the button text as well and in my case I only want to copy the numeric value .0006734, any idea how can I accomplish this?

FYI - It needs to be done programmatically due to some UI limitations.

Here is the code I'm currently using for the message box.

MessageBox.Show("Yields :  " + CStr(totalYields), "Yields X")    

在此处输入图片说明

@Bjørn-Roger Kringsjå -

This works, copying it to the clipboard was also an option. Thanks a lot

Clipboard.SetText( CStr(totalYields))

Thanks a lot

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM