-
I've got an application where I need to show some forms from a dll. The problem is trying to make these forms modal to the main form. I have an inkling that I've solved this problem before, but (!?) I can't remember how.
If I make the dll form modal, without a parent, then it still locks out the main form (like it should) but is not displayed on top of the main form. This means it can get lost behind other windows etc.
I've tried passing the parent form to the public class, but VB doesn't like it. I get an error: Private object modules cannot be used in public object modules as parameters or return types...blah...blah...blah
Any suggestions?
-
How are you loading the form? I call modal forms like this from my DLLs all the time and it works fine..
In my main app
Code:
Dim clForm as new myobject.myclass
clForm.show
In my DLL class
Code:
Public Function show()
frmabout.show vbModal 'frmabout is the form being loaded in the dll
End Function
-
thanks
Thanks. I figured it out. It was a problem that occured while running in debug mode. Once I compiled the dll and ran from that, the modal form worked as planned.
Regards,