Re: Application namespace isn't found? Can anyone help?

3 messages Options
Embed this post
Permalink
Stifu

Re: Application namespace isn't found? Can anyone help?

Reply Threaded More More options
Print post
Permalink

Did you try prefixing application with the full namespace?
Also, System.Windows.Forms.Application doesn't have a Quit method that I can
see. Maybe you meant to use the Exit one?


CajunCoder wrote:

>
> Hello Everyone,
>
> I'm a long time .NET Windows developer just taking the plunge into Mono.
> So I've got the following code:
>
> DialogResult dlgRslt;
>
> dlgRslt = MessageBox.Show("Are you sure you want to exit?",
>                                                 "Confirm Exit",
>                                                 MessageBoxButtons.YesNo,
> MessageBoxIcon.Question);
> if(dlgRslt == DialogResult.Yes){
>      Application.Quit();
> }
>
> Now. this code should work. But it doesn't! Instead, I get told by mono
> that "The name 'Application' does not exist in the current context"
>
> I am making sure I am using System and using System.Windows.Forms.
>
> Can anyone tell me what might be wrong? Also, I've taken away the () from
> the statement and I get the same thing.
>
> Thanks!
>

--
View this message in context: http://www.nabble.com/Application-namespace-isn%27t-found--Can-anyone-help--tp26072985p26073267.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list
Stifu

Re: Application namespace isn't found? Can anyone help?

Reply Threaded More More options
Print post
Permalink

It *should* work without having to type the full namespace, provided you have
the needed project reference and the needed using statement in the concerned
class... but from what you said, it seems you already have both, so I don't
know what's wrong.


CajunCoder wrote:

>
> It seems that when I use System.Windows.Forms.Application.Exit() it works.
> Indeed, I did mean Exit() instead of Quit but I hate having to type the
> full namespace every single time. Oh well.  I have another questions
> coming up though that *might* give a bit of challenge. lol
>
> Thanks again,
> Anthony
>
>
> Stifu wrote:
>>
>> Did you try prefixing application with the full namespace?
>> Also, System.Windows.Forms.Application doesn't have a Quit method that I
>> can see. Maybe you meant to use the Exit one?
>>
>>
>> CajunCoder wrote:
>>>
>>> Hello Everyone,
>>>
>>> I'm a long time .NET Windows developer just taking the plunge into Mono.
>>> So I've got the following code:
>>>
>>> DialogResult dlgRslt;
>>>
>>> dlgRslt = MessageBox.Show("Are you sure you want to exit?",
>>>                                                 "Confirm Exit",
>>>                                                 MessageBoxButtons.YesNo,
>>> MessageBoxIcon.Question);
>>> if(dlgRslt == DialogResult.Yes){
>>>      Application.Quit();
>>> }
>>>
>>> Now. this code should work. But it doesn't! Instead, I get told by mono
>>> that "The name 'Application' does not exist in the current context"
>>>
>>> I am making sure I am using System and using System.Windows.Forms.
>>>
>>> Can anyone tell me what might be wrong? Also, I've taken away the ()
>>> from the statement and I get the same thing.
>>>
>>> Thanks!
>>>
>>
>>
>
>

--
View this message in context: http://www.nabble.com/Application-namespace-isn%27t-found--Can-anyone-help--tp26072985p26073804.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list
Alex Shulgin

Re: Application namespace isn't found? Can anyone help?

Reply Threaded More More options
Print post
Permalink
Stifu wrote:
> It *should* work without having to type the full namespace, provided you have
> the needed project reference and the needed using statement in the concerned
> class... but from what you said, it seems you already have both, so I don't
> know what's wrong.

I'd suggest the OP to post a minimal _complete_ code to reproduce this
problem.

--
Reagards,
Alex
_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list