Build a "copy" button to copy and paste text into a different program...

Build a "copy" button to copy and paste text into a different program...

I have been building a program which generates text based on specific options and displays it in a pop up dialog box.  I would like to have a button which, on click, will copy all the text that is displayed, so I can take it and paste it somewhere else without having to highlight all of it, right-click, and copy.  Is there a way to do that?