Click here to Skip to main content
15,912,400 members
Home / Discussions / C#
   

C#

 
QuestionHow to set text of textbox with value user entered in another form at form close Pin
linqabc17-Apr-10 4:29
linqabc17-Apr-10 4:29 
AnswerRe: How to set text of textbox with value user entered in another form at form close Pin
Brij17-Apr-10 4:36
mentorBrij17-Apr-10 4:36 
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 
OMG | :OMG: DO NOT DO THAT!

See here[^]

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.

To add to that: What do you think static variables are? Again, this will cause you problems. Read up on the difference between a STATIC and a PUBLIC variable.

Also, it is considered bad practice to expose fields directly, and it makes it difficult to implement changes later. Use a property instead.

To add to the list: Don't use f2.ShowDialog() alone - always surround it with an "if" as in:
if (f2.ShowDialog() == DialogResult.OK)
   {
   ...
   }
Otherwise, what happens if the user decides he doesn't want to enter a value?
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

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 
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 

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.