Roger
Fri Dec 03 14:37:42 CST 2004
Hi Tom
Thanks enormously for your help with my beginners problems.
I imagined MessageBox came from System.Windows.Forms.Form as I don't recall
importing System.Windows.Forms as well as inheriting the 'form' when
developing an ordinary forms application.
Anyway you have solved the problem and thanks
Roger Stenson
"Tom Krueger [MSFT]" <a-tkrueg@online.microsoft.com> wrote in message
news:O60ghLN2EHA.2016@TK2MSFTNGP15.phx.gbl...
> Hello,
>
> To show a MessageBox or a Form from a class library you will need to add a
> reference to System.Windows.Forms. The MessageBox is in the
> System.Windows.Forms namespace. If you are using it from a class you will
> need to use/import the name space or write it out completely like
> System.Windows.Forms.MessageBox.Show("Hello World");
>
> In your main application you will need to add a reference to the class
> library.
>
> Hope that helps,
>
> Tom Krueger
>
> Smart Client DevCenter -
http://msdn.microsoft.com/smartclient/
> Mobile DevCenter -
http://msdn.microsoft.com/mobility
>
> This posting is provided "as is" with no warranties and confers no rights.
>
> "Roger Stenson" <roger.stenson1@ntlworld.com> wrote in message
> news:1DOrd.594$P35.255@newsfe4-win.ntli.net...
>> Hi
>> I am just beginning learning Dot Net, though I am a fairly experienced
>> VB6 traditional developer.
>>
>> I have a Solution which contains of libraries of classes which I want to
>> reuse widely in multiple projects , including some forms which I want to
>> inherit. These forms need to show the output of the back -office classes
>> often using 'MessageBox.Show.
>>
>> Because the form is stored in a class library it seems to have lost some
>> function including MessageBox. Is there a simple way round this by
>> importing the right namespace or is this a no-no for Windows forms stored
>> in Class Libraries
>>
>> Roger Stenson
>>
>
>