Shapes on Userforms - A .borderthickness work around

tbrock

New Member
Joined
Feb 17, 2016
Messages
35
Hello again,

I have what I thought would be a simple task: placing a *real* shape onto a user form.

I know this topic has been discussed before and even many year ago. Scouring the net, I have seen two possible methods via:
  • Autoshapes: (thank you, Andy Pope) But (if I have not misunderstood) this does not draw the shape onto the userform. Rather it creates the shape off form and then copies an image of that shape onto the form. This would, then have the disadvantage of having properties (backcolor, forecolor, text, etc) that are not modifiable without recreating a new image at every change (and for every property).
  • API: (thank you, Jaafar Tribak). This does create "shapes" directly upon the userform, but is it limited to very basic shapes and (I believe?) without all the properties that the shape object would have.
That leaves me thinking the "amazing", that something that seems so obvious (to me, at least) - drawing shapes on a userform - is not truly possible? I'd have thought this functionality would have been an obvious checklist item in the creation of userforms. (sigh) If I am wrong and it is possible to draw a shape onto a userform, please help me acheive an epiphany! :)

In trying to work around this seeming limitation in my current application, I could get away with a standard form object (label, textbox,frame,etc) IF border thickness/width/weight were settable. But I have not found a single (userform) object to this point that has this property. So this is my question:

Is there a userform placeable object (that could emulate a shape) which has a settable border width/thickness/weight?
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,975
Office Version
  1. 365
Platform
  1. Windows
I like how your example looks with just a blank white background. At that point, cell location would be unimportant.

VBA Code:
Sub DisplayAll(show As Boolean)
    Application.DisplayFormulaBar = show
    ActiveWindow.DisplayHeadings = show
    ActiveWindow.DisplayGridlines = show
End Sub

Clean look
VBA Code:
    Call DisplayAll(False)
Reinstate
VBA Code:
    Call DisplayAll(True)
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Watch MrExcel Video

Forum statistics

Threads
1,122,243
Messages
5,595,027
Members
413,960
Latest member
ikkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top