Jump to content
  • Advertisement
Sign in to follow this  
MilesRobson

C# n00bie question

This topic is 2344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been going though Head First C#, making little button and text box based questions. It's simple. fun, and I seem to be learning a lot.

I then thought of a neat little Windows Form Program I want to make, just a whole bunch of a buttons of ASCII art names, and then when they click the button, the art appears. Super easy.

But I figured I should bump it up a notch, and I want to make it so when the MessageBox.Show appears, they can Copy the art that shows up and paste it into Skype, FB, or whatever.

The issue I have is that you cannot copy from a MessageBox. The user cannot highlight the text or anything.

Is there a way to do that? Or have the program throw the art on to their clipboard (this might be too difficult for me, idk)?



I'll hunt around the interwebz and try to find a solution, but any ideas or advice will be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement

I've been going though Head First C#, making little button and text box based questions. It's simple. fun, and I seem to be learning a lot.

I then thought of a neat little Windows Form Program I want to make, just a whole bunch of a buttons of ASCII art names, and then when they click the button, the art appears. Super easy.

But I figured I should bump it up a notch, and I want to make it so when the MessageBox.Show appears, they can Copy the art that shows up and paste it into Skype, FB, or whatever.

The issue I have is that you cannot copy from a MessageBox. The user cannot highlight the text or anything.

Is there a way to do that? Or have the program throw the art on to their clipboard (this might be too difficult for me, idk)?



I'll hunt around the interwebz and try to find a solution, but any ideas or advice will be greatly appreciated!


Is there a way to do it? YES. Are you ready for it? Not a chance.

MessageBox is a system dialog that does not support Drag/Drop or Copy. So there is no easy way to do it. Now there are ways to do it with system calls using PInvoke. But you are not even close to being ready to go there.

theTRoll

Share this post


Link to post
Share on other sites
In Vista and later, you can actually copy the contents of a standard messagebox by pressing ctrl+a (for select all) and ctrl+c (copy selection).

That said, copying a string directly to clipboard programmatically is very easy.

Share this post


Link to post
Share on other sites

I expect it will be easy enough for you to make a new form with a text box in it you can copy from instead of trying to do it with a message box.


Is there a property to make a TextBox un-editable?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!