|
-
Nov 17th, 2015, 12:56 AM
#1
Thread Starter
Addicted Member
[RESOLVED] UserControl with custom Property Page
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
My projects:
Virtual Forms
VBA Telemetry
-
Nov 17th, 2015, 08:03 AM
#2
Re: UserControl with custom Property Page
This seems to work:
Code:
Private Sub UserControl_InitProperties()
If Not Ambient.UserMode Then CreateObject("WScript.Shell").SendKeys "+{F4}"
End Sub
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Nov 18th, 2015, 06:37 AM
#3
Thread Starter
Addicted Member
Re: UserControl with custom Property Page
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?
My projects:
Virtual Forms
VBA Telemetry
-
Nov 18th, 2015, 12:16 PM
#4
Re: UserControl with custom 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.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Nov 19th, 2015, 04:47 AM
#5
Thread Starter
Addicted Member
Re: UserControl with custom Property Page
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.
My projects:
Virtual Forms
VBA Telemetry
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|