Can it be done?

A

Austin Myers

I've found lots of code examples in VB to change a forms shape, is there
anything like it avilable for VBA forms?
 
P

Peter Huang [MSFT]

Hi

I think it can be done but I recommend you not do that in VBA because VBA
of Office will run in the Office Process and create the abnormal shaped
windows will need call many windows API to deal with the windows handle
that may make the office instable.

If you want to show such window, I suggest you create the window in a VB6
DLL and then call the DLL in VBA directly.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jonathan West

Austin Myers said:
I've found lots of code examples in VB to change a forms shape, is there
anything like it avilable for VBA forms?

Hi Austin,

Most routines designed to work with VB6 Forms will fail on VBA UserForms.
Despite their apparent similarity, UserForms are a quite different animal
from VB6 Forms, using a completely separate library from VB6. The controls
are different (and usually windowless) and the form and its controls do not
include the hWnd or hDC properties, which are heavily used in these kind of
advanced manipulations.

You probably can duplicate some of the behavior of the VB6 code, but it
would be hard going and you would probably need to make extensive changes to
the code samples to make them work in VBA. There are for instance ways of
getting hold of the hwnd & hDC of windows and controls. But some of these
advanced featues require that you subclass the Form. I believe that Karl
Peterson has been experimenting with subclassing UserForms, but I don't
think he has managed a stable solution yet.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
A

Austin Myers

Thanks for the feedback. Not exactly what I wanted to hear but pretty much
what I suspected to be the case.
 
P

Peter Huang [MSFT]

Hi

Thanks for your quickly reply!

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top