Pop up box with Ok and Cancel choices, not working. Please Help.

Hello! I am trying to create a pop up box that allows users to choose Ok and Cancel (i'm just testing with Ok and Cancel for now). For some reason when I run it a CMD line pops up and closes very quickly, but i do not get errors. Here is my code:
      private void button1_Click(object sender, EventArgs e)
            PopupForm popup = new PopupForm();
            DialogResult dialogresult = popup.ShowDialog();
            if (dialogresult == DialogResult.OK)
                Console.WriteLine("You clicked OK");
            else if (dialogresult == DialogResult.Cancel)
                Console.WriteLine("You clicked either Cancel or X button in the top right corner");
            popup.Dispose();
Please help! 
Thanks
- Rocketman123

Hi Rocketman123,
Per my understanding, you are developing a winform application, but in your code, I see "Console.WriteLine".
So please use MessageBox.Show() instead.
http://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(System.Windows.Forms.MessageBox.Show);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5);k(DevLang-csharp)&rd=true
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

Maybe you are looking for

  • How can I access Advanced Javascript Settings?

    I'm aware that, in recent versions of Firefox, the ability to disable Javascript has been removed. I don't intend to re-open discussion of that particular decision. But removing that option has also removed access to the Advanced Javascript Settings

  • Confirmation with errors in calc. actual costs for PM-order

    Hi, We have a PM-order with notifications and good movements that has tecnical completion status and is already settled. So we want to set it with bussines completion status, but an error arises: "Unprocessed future change recs for order 5009385 prev

  • OS 10.6.3 & DVD burning failure

    Not too long ago I downloaded and installed an update to Snow Leopard. Since that time I have , once again, been unable to successfully burn DVDs. CDs will burn just fine but the internal optical drive and my external LaCie optical drive will not bur

  • Smart Object goes to Preview not Illus

    I recently upgraded to Maverick.  I have found to my frustration that when I click on an Illustrator file that it opens as a pic in Mac's Preview - which I don't want.  Now, worst of all, if I click on a smart object in Photoshop it should take me to

  • Iphoto folders(organized) transferred to photoshop?

    Due to my occupation I have to use a PC. I have photoshop on both Mac and PC. 1. Is there any way to transfer my iphoto folders and pics to windows and keep the organization I have? 2. Is there anyway to keep organization of iphoto folders and pics a