Hi. Please, I need help with the VBA. How to draw in UserForm? For example, I press a key and a rectangle (or line or circle) appears on the UserForm)
Sorry for my English
Hi. Your draw (rectangle, line or circle) is "image1" (a bitmap)
Private Sub UserForm_Activate() 'when the form loads
Image1.Visible = False
Private Sub UserForm_Click() 'when you click in the form
Image1.Visible = True
Can you explain, please, why do you have such a need?
Practically I do not think it is possible (easily) to draw something directly on the form, but you can trick that drawing on the page, saving the drawing somewhere in your computer, creating a control on the fly (let's say a label) and connect the label.Picture property to the recent saved picture... All that programmatically done.
I think I can show you something in order to understand the trick. Of course if it fills your needs...
Thanks, but it's too easy. And I need something more. I want to draw a preview of my macro action. Such rectangles and lines will be many
I understand what you're saying. It's not exactly, but I'd like to see you do it. Probably have to do as you said. Show an example
Maybe you should save one image with all the figures together.