.net C# windows Form Application : open popup window
-
I am using Windows Form application. I want to open a small textbox on a window to enter user's name or Email in Starting for the program. How can I achieve this?
-
Answer:
Write one, 'tis almost trivial (creating the form and adding label, textbox and buttons) and using the VB one is perputating something that was only put in to appease the baying mob. Key method is ShowDialog() which is a method on a Form. On the form make sure you set the flags for the Ok and Cancel buttons correctly and provide a property (ideally) to allow you to read (and write if necessary) the text box You can then do something along the lines of the following: using(MyInputForm mif = new MyInputForm) { if (mif.ShowDialog() == DialogResult.OK) { dataFromDialog = mif.InputData; } else { // logic to deal with cancel } } You can do something similar in WPF, don't have an example to hand though.
Sujoy at Stack Overflow Visit the source
Other answers
Maybe the answer to this question will help: http://stackoverflow.com/questions/97097/what-is-the-c-version-of-vb-nets-inputdialog
Philip Wallace
Related Q & A:
- What is the difference between C# and C#.NET?Best solution by Stack Overflow
- How do I open a window from the outside?Best solution by Yahoo! Answers
- Is there some kind of API for MSN protocol (for using in C# asp.net application?Best solution by Stack Overflow
- Why do flight attendants ask us to open the window shades before take off and landing?Best solution by Yahoo! Answers
- Why won't Windows Live Messenger open?Best solution by answers.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.