Click here to Skip to main content
15,904,346 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dataset Accept change is not working Pin
Peace ON5-May-10 21:13
Peace ON5-May-10 21:13 
Questioni m in need of application code Pin
manila dahal5-May-10 18:06
manila dahal5-May-10 18:06 
AnswerRe: i m in need of application code Pin
riced5-May-10 21:11
riced5-May-10 21:11 
AnswerRe: i m in need of application code Pin
Eddy Vluggen6-May-10 1:03
professionalEddy Vluggen6-May-10 1:03 
QuestionUpdating controls on another form Pin
gmhanna5-May-10 17:57
gmhanna5-May-10 17:57 
AnswerRe: Updating controls on another form Pin
Peace ON5-May-10 21:23
Peace ON5-May-10 21:23 
GeneralRe: Updating controls on another form Pin
DaveyM695-May-10 23:40
professionalDaveyM695-May-10 23:40 
AnswerRe: Updating controls on another form Pin
DaveyM695-May-10 23:29
professionalDaveyM695-May-10 23:29 
Assuming Form1 is the main form that runs when the application starts and is therefore instanciating Form2...

Information can be passed from Form2 to Form1 in 3 ways.

1. When you create your Form2 instance, store it in a private field so you can use it outside of the method that does the instanciation. Have an internal or public property that holds the data you need in Form2. Form1 can access this when required by using the field.Property.

2. The same as 1, but use a method instead of a property.

3. Create a custom EventArgs class, then in Form2, create an event and a raising method passing an instance of these args. When Form1 creates the Form2 instance, it can subscribe to the event.

1 and 2 require Form1 to poll Form2 for data, in 3 Form2 signals Form1 when there is new data.

Example of 3 - here[^], and further information about events here[^].
Dave

If this helped, please vote & accept answer!


Binging is like googling, it just feels dirtier. (Pete O'Hanlon)

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)

QuestionRead certificate from USB Pin
Maurinho05-May-10 12:34
Maurinho05-May-10 12:34 
AnswerRe: Read certificate from USB Pin
AspDotNetDev5-May-10 15:15
protectorAspDotNetDev5-May-10 15:15 
QuestionAdding text box input to a dataset table Pin
mprice2145-May-10 11:34
mprice2145-May-10 11:34 
AnswerRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 11:57
professionalDr.Walt Fair, PE5-May-10 11:57 
GeneralRe: Adding text box input to a dataset table Pin
mprice2145-May-10 12:13
mprice2145-May-10 12:13 
GeneralRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 15:10
professionalDr.Walt Fair, PE5-May-10 15:10 
GeneralRe: Adding text box input to a dataset table [modified] Pin
mprice2145-May-10 15:45
mprice2145-May-10 15:45 
GeneralRe: Adding text box input to a dataset table Pin
Dr.Walt Fair, PE5-May-10 16:47
professionalDr.Walt Fair, PE5-May-10 16:47 
QuestionMessage Removed Pin
5-May-10 9:16
professionalN_tro_P5-May-10 9:16 
QuestionEnum logic problem [modified] Pin
venomation5-May-10 8:02
venomation5-May-10 8:02 
AnswerRe: Enum logic problem Pin
Ian Shlasko5-May-10 8:19
Ian Shlasko5-May-10 8:19 
AnswerRe: Enum logic problem Pin
venomation5-May-10 8:24
venomation5-May-10 8:24 
Questiondocument code Pin
toto_20105-May-10 7:13
toto_20105-May-10 7:13 
AnswerRe: document code Pin
dan!sh 5-May-10 7:24
professional dan!sh 5-May-10 7:24 
AnswerRe: document code Pin
Richard MacCutchan5-May-10 7:26
mveRichard MacCutchan5-May-10 7:26 
AnswerRe: document code Pin
Pete O'Hanlon5-May-10 9:26
mvePete O'Hanlon5-May-10 9:26 
AnswerRe: document code Pin
Dave Kreskowiak5-May-10 9:32
mveDave Kreskowiak5-May-10 9:32 

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.