Click here to Skip to main content
15,923,852 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
OriginalGriff17-Apr-10 4:50
mveOriginalGriff17-Apr-10 4:50 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
Brij18-Apr-10 0:26
mentorBrij18-Apr-10 0:26 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
linqabc17-Apr-10 22:21
linqabc17-Apr-10 22:21 
AnswerRe: How to set text of textbox with value user entered in another form at form close Pin
OriginalGriff17-Apr-10 4:47
mveOriginalGriff17-Apr-10 4:47 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
linqabc17-Apr-10 22:26
linqabc17-Apr-10 22:26 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
OriginalGriff17-Apr-10 22:36
mveOriginalGriff17-Apr-10 22:36 
GeneralRe: How to set text of textbox with value user entered in another form at form close Pin
linqabc17-Apr-10 22:52
linqabc17-Apr-10 22:52 
GeneralRe: How to set text of textbox with value user entered in another form at form close (alternative method) Pin
supercat919-Apr-10 5:48
supercat919-Apr-10 5:48 
OriginalGriff wrote:
When you dispose a control, you have no control over when it's memory is available - the garbage collector is a liberty to remove it at any time. The code may work now, in testing, and then fail intermittently for no apparent reason later.


The garbage collector cannot remove a disposed control if any references to it exist. If there are any user fields or properties, within a control, those fields will continue to be valid, even after the control is disposed, with the exception of properties that explicitly check for isDisposed and will throw exception exception if it is set.

As for the best way to return the content of a form that is invoked modally, I would suggest that rather than using events, one (1) define a class which contains the form's contents and an enumerated type listing methods of exit; (2) define a method in the form which will ShowDialog itself and then return an object of the class in '1' filled with the values from the form; (3) define a static method in the form which will create a new instance, call the method in '2', and dispose of the instance. That would avoid any excess dependencies between the child form and the main form, and avoid having to add any extra code into the calling form.
QuestionOutlook Plug-in Button Issue! Pin
Sr...Frank16-Apr-10 23:09
Sr...Frank16-Apr-10 23:09 
AnswerRe: Outlook Plug-in Button Issue! Pin
Md. Marufuzzaman18-Apr-10 1:38
professionalMd. Marufuzzaman18-Apr-10 1:38 
QuestionTimer tick event count Pin
mprice21416-Apr-10 18:00
mprice21416-Apr-10 18:00 
AnswerRe: Timer tick event count Pin
OriginalGriff16-Apr-10 21:48
mveOriginalGriff16-Apr-10 21:48 
GeneralRe: Timer tick event count Pin
mprice21417-Apr-10 4:07
mprice21417-Apr-10 4:07 
GeneralRe: Timer tick event count Pin
OriginalGriff17-Apr-10 4:51
mveOriginalGriff17-Apr-10 4:51 
QuestionDisconnected Context Issue Pin
tims8116-Apr-10 14:03
tims8116-Apr-10 14:03 
AnswerRe: Disconnected Context Issue Pin
cbin9-Feb-11 22:34
cbin9-Feb-11 22:34 
Questionhow to input image in c#[modified] Pin
samuel200216-Apr-10 10:31
samuel200216-Apr-10 10:31 
AnswerRe: how to input image in c Pin
Tarakeshwar Reddy16-Apr-10 11:37
professionalTarakeshwar Reddy16-Apr-10 11:37 
QuestionHow to Make textbox autocomplete? Pin
lamiaa_12316-Apr-10 10:13
lamiaa_12316-Apr-10 10:13 
AnswerRe: How to Make textbox autocomplete? Pin
Jimmanuel16-Apr-10 10:24
Jimmanuel16-Apr-10 10:24 
GeneralRe: How to Make textbox autocomplete? Pin
linqabc16-Apr-10 22:56
linqabc16-Apr-10 22:56 
GeneralRe: How to Make textbox autocomplete? Pin
Jimmanuel17-Apr-10 1:47
Jimmanuel17-Apr-10 1:47 
AnswerRe: How to Make textbox autocomplete? Pin
Ravi Bhavnani16-Apr-10 12:29
professionalRavi Bhavnani16-Apr-10 12:29 
QuestionHow to auto-select a newly added row in the DataGrid? [modified] Pin
Donnelly James16-Apr-10 9:23
Donnelly James16-Apr-10 9:23 
AnswerRe: How to auto-select a newly added row in the DataGrid? Pin
Dave Buhl16-Apr-10 12:04
Dave Buhl16-Apr-10 12:04 

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.