Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: ColumnChanging event on Dataset Pin
link_799-Jun-04 9:16
link_799-Jun-04 9:16 
GeneralWan x Lan Pin
crisyuri9-Jun-04 7:08
crisyuri9-Jun-04 7:08 
GeneralRe: Wan x Lan Pin
Dave Kreskowiak9-Jun-04 9:37
mveDave Kreskowiak9-Jun-04 9:37 
GeneralWindows Forms Question Pin
OMalleyW9-Jun-04 6:15
OMalleyW9-Jun-04 6:15 
GeneralRe: Windows Forms Question Pin
Michael Potter9-Jun-04 6:24
Michael Potter9-Jun-04 6:24 
GeneralRe: Windows Forms Question Pin
OMalleyW9-Jun-04 7:49
OMalleyW9-Jun-04 7:49 
GeneralRe: Windows Forms Question Pin
Michael Potter10-Jun-04 4:08
Michael Potter10-Jun-04 4:08 
GeneralRe: Windows Forms Question Pin
Heath Stewart9-Jun-04 8:29
protectorHeath Stewart9-Jun-04 8:29 
The simplest way is to pass a reference of the first form to the second form, either by passing it to the other form's constructor or assigning it to a property. Don't just use Form, though. Declare the type of the parameter or property the actual type of your form so that you can easily access public or internal members.

Typically, though, it's easy to "return" a value. For instance, you could declare a property that can get (or optionally set) the part name for which similar part names should be found. When that form returns, get the value (which the popup form sets):
private void someButton_Click(object sender, EventArgs e)
{
  using (PopupForm form = new PopupForm())
  {
    form.PartName = "asdf";
    form.ShowDialog(this);
    someTextBox.Text = form.PartName;
  }
}
Using this approach allows you to reuse that popup form from other forms when you need it.

 

Microsoft MVP, Visual C#
My Articles
Generaldatagrid, datatable adding new rows Pin
HappyPaws9-Jun-04 6:02
HappyPaws9-Jun-04 6:02 
GeneralRe: datagrid, datatable adding new rows Pin
Heath Stewart9-Jun-04 6:07
protectorHeath Stewart9-Jun-04 6:07 
GeneralRe: datagrid, datatable adding new rows Pin
HappyPaws9-Jun-04 8:22
HappyPaws9-Jun-04 8:22 
GeneralRe: datagrid, datatable adding new rows Pin
Heath Stewart9-Jun-04 8:31
protectorHeath Stewart9-Jun-04 8:31 
QuestionLock Excel process? Pin
the last free name9-Jun-04 6:01
the last free name9-Jun-04 6:01 
AnswerRe: Lock Excel process? Pin
Dave Kreskowiak9-Jun-04 11:48
mveDave Kreskowiak9-Jun-04 11:48 
GeneralSkinning Pin
Simon Wren9-Jun-04 5:49
professionalSimon Wren9-Jun-04 5:49 
GeneralRe: Skinning Pin
Heath Stewart9-Jun-04 5:58
protectorHeath Stewart9-Jun-04 5:58 
GeneralRe: Skinning Pin
Simon Wren9-Jun-04 6:03
professionalSimon Wren9-Jun-04 6:03 
GeneralRe: Skinning Pin
Wackatronic10-Jun-04 5:19
Wackatronic10-Jun-04 5:19 
GeneralIP address from VPN connection Pin
Judah Gabriel Himango9-Jun-04 5:20
sponsorJudah Gabriel Himango9-Jun-04 5:20 
GeneralRe: IP address from VPN connection [EDITED] Pin
Dave Kreskowiak9-Jun-04 9:02
mveDave Kreskowiak9-Jun-04 9:02 
GeneralRe: IP address from VPN connection [EDITED] Pin
Judah Gabriel Himango9-Jun-04 9:50
sponsorJudah Gabriel Himango9-Jun-04 9:50 
GeneralLoop through many textboxes Pin
mkennedy779-Jun-04 4:57
mkennedy779-Jun-04 4:57 
GeneralRe: Loop through many textboxes Pin
Guinness4Strength9-Jun-04 5:14
Guinness4Strength9-Jun-04 5:14 
GeneralRe: Loop through many textboxes Pin
Heath Stewart9-Jun-04 5:48
protectorHeath Stewart9-Jun-04 5:48 
GeneralRe: Loop through many textboxes Pin
Guinness4Strength9-Jun-04 5:23
Guinness4Strength9-Jun-04 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.