Click here to Skip to main content
15,889,992 members
Home / Discussions / C#
   

C#

 
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 
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 
Luc Pattyn wrote:
that's "If it's set already, you don't need to new it up"


hmm well i took that to mean, i dont need to use the new command when i want to make the form appear, so i tried everything i could to get a form to appear without using 'new'.

so by coding discipline you mean something like:
try
            {
                setting.Activate();
            }
            catch
            {
                setting = new Settings();
                setting.Show();
            }


Cos i was thinking of just using something like an if statement but it didnt feel right. it just felt like there should be some way of declaring a form that was used across the whole class (like declaring a variable, where if i change it in one method, it can be accessed in another method and have the same value. although thinking about this, the variable must be created as the application starts, just like my form was when i was using public Settings setting = new Settings(); - i kept getting a form straight away. its a pity that in order to own a form, you need another form to own it, otherwise i could have used something like
setting = new Settings();
setting.showdialog(this);

which would allow only one to be created?

so as for number 3, is it better to reuse the same form? should i create my form as soon as my application starts but use a myForm.Hide(); ? at the minute im using Application.Run(); and not Application.Run(new myForm); as it would be when you start a default windows application on c#. the later would create the form straight away... but i could then hide it somehow?

if i created my form straight away, i could use a notifyicon attached to it to Show and Hide it and exit my script, if not, i can do what i am doing at the minute and include my notifyicon in my Main() area...
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 
QuestionUpdate only changed record. Pin
hdv21219-Feb-09 12:38
hdv21219-Feb-09 12:38 
AnswerRe: Update only changed record. Pin
Mycroft Holmes19-Feb-09 13:41
professionalMycroft Holmes19-Feb-09 13:41 
GeneralRe: Update only changed record. Pin
hdv21219-Feb-09 13:48
hdv21219-Feb-09 13:48 
GeneralRe: Update only changed record. Pin
Mycroft Holmes19-Feb-09 14:07
professionalMycroft Holmes19-Feb-09 14:07 

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.