How do i centre a ActiveX DLL 's form inside a main application MDI window.
I have used the activex dll as plugin to the main application
Printable View
How do i centre a ActiveX DLL 's form inside a main application MDI window.
I have used the activex dll as plugin to the main application
Pass the form as either a Form or an Object to the dll (not sure without checking if a form is allowed), then you can show the form using the optional parent parameter. If you've set the forms Startup position to centerowner, it should work.
Note though that you can't put an mdi child in a dll; if you want it to act like an mdi child you need to modify the window style and make the mdi form the parent of your form.
Crazy D @ Work :-)
Just as a side note Dan Appleman (he of the WinAPI bible) wrote an excellent article in the VBPJ last march on developing an extendable MDI framework using ActiveX DLL's and forms. I lost my copy of the magazine ages ago, but just noticed that it's now freely available on the MSDN at :
http://msdn.microsoft.com/library/pe...bpj/da0399.htm
It's a bit heavy going, but well worth it if you want to develop an extendable MDI system. (much better than the clunky SetParent API anyway!)
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
That's a cool one Chris!
Crazy D @ Work :-)