Page 1 of 1
dll files
Posted: Thu Apr 29, 2010 2:55 am
by dan2130
Hi, when i do a dll i need to show a form after action but when i write form1.show() at the end of the sub the dll file say to me an error but i want to do that application with dll for more compatibility with the others apps i will made but if you know how i can open a form by a sub in a dll please can you tell that to me i have searched and i have found nothing or i found only how to say a msgbox.
thanks in advance
Re: dll files
Posted: Fri Apr 30, 2010 12:57 am
by CodenStuff
Hello,
If you want to show a form from your DLL you first need to add a form to the dll project. If you want to show the form using code inside the dll file then putting a sub inside the dll should work like:
Code: Select allPublic Sub ShowForm()
Form1.ShowDialog()
End Sub
If you want to show the form from your DLL using code inside your main application then you need to create a new instance of it like this:
Code: Select allDim ShowForm As New NameOfYourDLLFile.Form1
ShowForm.ShowDialog()
Replace "NameOfYourDLLFile" with the name of your DLL and dont forget you need to add your DLL as a reference in your main application though cooll;
Re: dll files
Posted: Fri Apr 30, 2010 1:00 am
by dan2130
i can not open a form in the main application from the dll like the code of the dll open the form 2 of the main application (windows application)
Re: dll files
Posted: Fri Apr 30, 2010 2:03 am
by CodenStuff
Hello,
As far as I know your not going to be able to do that directly unless you make the dll inside the same project as your main application.
What exactly are you trying to do though? . I mean why does your DLL need to open a form from your main application?
Re: dll files
Posted: Fri Apr 30, 2010 2:04 am
by dan2130
ok