Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi all,
 
My question is how can be create a Popup window,when we click on a button then popup window is flashed and we enter something in textbox existing in popup and when we click on save the data gets in the textbox of the main window. for example: i want to create a Unit Converter popup which will convert feet into mtrs,cms,inches and after the conversion it show the result in the textbox present on the Main Window.Hope u got what i am trying to say...
Posted 25-Jul-11 21:20pm
Comments
jkarthick1989 at 26-Jul-11 2:23am
   
Create an object for your Popup window like...
 
Form1 f = new Form1();
f.showDialog();
 
Will show your Form1...
Hope this helps...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Let's say you called your popup window class "PopupWindow". You created it by right-clicking on your project in project explorer and chosing "Add new Windows Form". Then you added a text box and an "Ok"-Button.
 
You also added a property to your form so that you can later gain access to the data the user entered in the text box.
public class PopupWindow
{
    public string EnteredText
    {
        get
        {
            return( textBox.Text );
        }
    }
}
Now you use your new class like this:
PopupWindow popup = new PopupWindow();
 
popup.ShowDialog();
 
string userEnteredText = popup.EnteredText;
 
popup.Dispose();
  Permalink  
Comments
ubo253 at 26-Mar-13 12:54pm
   
Its useful.Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Add new form to your solution,eg Abc
 
on button click,make an object of that form
Abc a= new Abc();
a.ShowDialog();
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

I think we should use popup controls from vb.net and show the popup
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.150302.1 | Last Updated 29 Oct 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100