A ProgID is mapped to a class identifier (CLSID). A text string with no spaces that identifies an object class. ![]() The first argument is going to reference what type of control you want to add, and it is ProgID which is defined as To add controls to a userform or a frame you use the add method. Set Cmd = ("Forms.CommandButton.1", "cmd1") Private WithEvents Cmd As MSForms.CommandButton So with this method you need to pre-write any event code you want for any controls you create.Īlso note that you can position and size your controls even if the top, left, width, and height properties don't necessarily come up in intellisense. You can set the control which gets returned to a WithEvents control variable that you have defined in the UserForm code module so you can respond to events on whatever controls you want. In the form I used I had a frame control named Frame1, so in the UserForm_Initialize you call to embed a control in the frame. ![]() The following code demonstrates how you can dynamically populate a frame in a userform with controls.
0 Comments
Leave a Reply. |