PDA

View Full Version : vba adding image after clicking on the textbox



tusia13pl
08-14-2017, 03:15 AM
Hi,

I'm new to VBA programming so thank you in advance for any help.
I need to assign image to the textbox to work this way: when I click on the text box, then the image is showing.
I think the easiest way is changing textbox to commandbutton and making userform with image. Unfortunetly, i got a lot of this textboxes near to each other and the commandbutton have this thick frame.
Do you have a idea how to assign userform to the text box or how to erase this frame?

Regards

offthelip
08-14-2017, 04:33 AM
Why not use a button form control which you can make as small as you like. then assign a macro to it which shows the userform:


Sub showim()
UserForm1.Show


End Sub

mdmackillop
08-14-2017, 05:06 AM
I don't know what you mean by "image is showing". You could use an ActiveX textbox and use its methods.



Private Sub TextBox1_GotFocus()
MsgBox "Test"
End Sub