Skip to Main Content
CorelDRAW Ideas Portal
Created by Miroslav Balchev
Created on Feb 17, 2023

BhBp F2 - F12 USER FORM /USER INTERFACE EXTENSION/

Hello, everybody!
It's not an idea, it's a way of working.
Made a macro that ufCommand.show and assign F2 and F12 to run this macro. The buttons are comfortable to press with either the left or right hand. Pressing F2/F12 shows a user form ufCommands where we can easily place our controls. This is our lab. The most important button of this form is colored green and pressing it opens the form in VBA in edit mode. In this mode, we can easily make changes to the shape and controls. That's the idea, and here's the code for the green button.

Private Sub cbBhBp_Green2_Click()

Application.GlobalUserData(meTopLeft, 1) = Me.Top

Application.GlobalUserData(meTopLeft, 2) = Me.Left

Dim vbeditor As VBIDE.VBE

Application.VBE.MainWindow.Visible = True

Set vbeditor = Application.VBE

'MsgBox vbeditor.VBProjects("GlobalMacros").VBComponents.Count

'vbeditor.VBProjects("GlobalMacros").VBComponents("ufCommands").Activate

'vbeditor.VBProjects("GlobalMacros").VBComponents(Me.Name).Activate

vbeditor.ActiveVBProject.VBComponents(Me.Name).Activate

End Sub


Placing this button on any custom form will display the custom form in edit mode in the VBE. The custom form will be available in any document if it is made in Globalmacros.gms or similar

Greetings!


  • Attach files