Click here to Skip to main content
16,005,467 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 11:52
samskiter20-Feb-09 11:52 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
DaveyM6920-Feb-09 12:35
professionalDaveyM6920-Feb-09 12:35 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 13:09
samskiter20-Feb-09 13:09 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
DaveyM6920-Feb-09 13:28
professionalDaveyM6920-Feb-09 13:28 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 13:31
samskiter20-Feb-09 13:31 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
DaveyM6920-Feb-09 13:38
professionalDaveyM6920-Feb-09 13:38 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 14:08
samskiter20-Feb-09 14:08 
AnswerRe: Help showing a form - "Object reference not set to an instance of an object." Pin
Luc Pattyn20-Feb-09 1:46
sitebuilderLuc Pattyn20-Feb-09 1:46 
If your app needs to show a Form on occasion, you only have two options:
- instantiate and show the Form every time you need it;
- instantiate it once, and Show/Hide it as needed.

The amount of code will not vary much; keeping the Form alive but hidden has the characteristic that all Controls retain their settings (e.g. text entered in a TextBox by the user). The price to pay is the memory the Form is using.

BTW: you don't have to instantiate the Form right away, as in initialization code
(private Form myForm=new Form...); you can also have one or more if (myForm==null) myForm=new Form(); so the Form gets instantiated if and when it is needed for the first time.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


modified on Sunday, June 12, 2011 8:23 AM

GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 5:40
samskiter20-Feb-09 5:40 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter19-Feb-09 18:30
samskiter19-Feb-09 18:30 
AnswerRe: Help showing a form - "Object reference not set to an instance of an object." Pin
Luc Pattyn20-Feb-09 1:21
sitebuilderLuc Pattyn20-Feb-09 1:21 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 5:24
samskiter20-Feb-09 5:24 
AnswerRe: Help showing a form - "Object reference not set to an instance of an object." Pin
Luc Pattyn20-Feb-09 5:36
sitebuilderLuc Pattyn20-Feb-09 5:36 
GeneralRe: Help showing a form - "Object reference not set to an instance of an object." Pin
samskiter20-Feb-09 5:59
samskiter20-Feb-09 5:59 
QuestionSocket security Pin
yesu prakash19-Feb-09 17:19
yesu prakash19-Feb-09 17:19 
AnswerRe: Socket security Pin
cmk19-Feb-09 19:52
cmk19-Feb-09 19:52 
GeneralRe: Socket security Pin
yesu prakash19-Feb-09 20:20
yesu prakash19-Feb-09 20:20 
QuestionHow can i know which key value(which is an int value) is the smallest or highest in c#? Pin
merryjoy00019-Feb-09 17:14
merryjoy00019-Feb-09 17:14 
AnswerRe: How can i know which key value(which is an int value) is the smallest or highest in c#? Pin
Luc Pattyn19-Feb-09 17:52
sitebuilderLuc Pattyn19-Feb-09 17:52 
QuestionHow can i get the highest value in a hash table using c# Pin
merryjoy00019-Feb-09 16:56
merryjoy00019-Feb-09 16:56 
AnswerRe: How can i get the highest value in a hash table using c# Pin
Calin Tatar19-Feb-09 22:21
Calin Tatar19-Feb-09 22:21 
QuestionFTP Parse LIST Command Pin
User 572816019-Feb-09 16:46
User 572816019-Feb-09 16:46 
QuestionSPList and FileNotFoundException Pin
Not Active19-Feb-09 16:02
mentorNot Active19-Feb-09 16:02 
Questionc# code to count ,how many times a method is called? Pin
merryjoy00019-Feb-09 16:01
merryjoy00019-Feb-09 16:01 
AnswerRe: c# code to count ,how many times a method is called? Pin
Richard Andrew x6419-Feb-09 16:23
professionalRichard Andrew x6419-Feb-09 16: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.