Hello.
I'm having a simple usercontrol with 1 custom property page. Is there a way to programmatically open this property page when I create this control on a form?
Thnx, Davor
Printable View
Hello.
I'm having a simple usercontrol with 1 custom property page. Is there a way to programmatically open this property page when I create this control on a form?
Thnx, Davor
This seems to work:
Code:Private Sub UserControl_InitProperties()
If Not Ambient.UserMode Then CreateObject("WScript.Shell").SendKeys "+{F4}"
End Sub
Hello Bonnie West,
Thank you for your post. This works great in vb6. But doesn't work if I compile ocx and use it in Office (for example Excel).
Is there any solution for using this in office to pop up property page?
That simple code basically just presses the VB6 IDE's shortcut key (Shift+F4) for displaying the Property Pages dialog box of the currently selected object. If Excel and other MS Office apps have an equivalent shortcut key, use them instead. You are probably going to have to figure out a way of determining your UC's host if you want a solution that works in all situations.
Thank you Bonnie West.
The simplest solutions are always the best. It is not difficult to complicate, but it is difficult to make a complicated thing in a simple way.