Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MessageBox in DLL 2

Status
Not open for further replies.

sacsac

Programmer
Dec 10, 2000
182
GB
In VB6 I could quite easily have a MessageBox pop up to tell the user something. However, in .NET I find that I cannot apparently use MessageBox within a DLL class. Is there a workround of any kind?
 
if you import system.windows.forms you will find the messagbox there and you will be able to use it like you wish.

system.windows.forms is not imported by default in a class library project but it is still there if you want to use it.

Christiaan Baes
Belgium

"My new site" - Me
 
Thanks for this advice Chrissie1.

I've tried this, but when I try to add the line "imports System.Windows.Forms" to my class I get an error "namespace or type specified does not contain any public member or can not be found". I'm still struggling here!
 
You will ha ve to add the same reference to your references.

It's called System.windows.forms.dll and it's in the .net section.

Christiaan Baes
Belgium

"My new site" - Me
 
You will need to add System.Windows.Forms.dll to your Class Library's References before you can import it.

Right Click on References (under your Class Library project in Solution Explorer) and select Add Reference. Scroll to System.Windows.Forms.dll and then select it.


Hope this helps.

[vampire][bat]
 
Many thanks chrissie1 and earthandfire.

It's so good to know that there are people out there prepared to help a struggling newcomer to .NET
I'm sure that my questions must seem so obvious to you all, but I'm finding the change from old VB6 to .NET quite challenging.

Thanks again!
 
chrissie - very, very!
Rick - busy.

I have a quick wander round the various fora most days, but just don't have much time to post at the moment.

Hopefully, I'll be posting more in a few weeks time - but at least this forum seems to be in good hands at the moment.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top