VBA shape SpecialEffect and/or BorderColor properties?

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,570
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
On my userform, I have a textbox (uf1vb1_OPS) that has code written to it when clicked by the user executes code which. I wish to mimic as a button.
By default, the shape's SPECIALEFFECT property is Raised (1- frmSpecialEffectRaised). When the user clicks the shape, I want the button to appear depressed with a green border ...

Code:
    With uf1vb1_OPS
        .ForeColor = RGB(160, 160, 160) 'grey
        .SpecialEffect = frmSpecialEffectSunken
        .BorderColor = RGB(0, 153, 0) 'green
    End With

The text in the shape changes to grey, but there is no border let alone a green one.

Am I missing something?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I have a feeling that you will only see the order colour if the effect is "Flat"
 
Upvote 0
Hi

I think border style is set up on none by default

Code:
 With TextBox1      [LEFT][COLOR=#222222][FONT=Verdana].BorderStyle = fmBorderStyleSingle[/FONT][/COLOR][/LEFT]
.BorderColor = RGB(0, 153, 0) 'green
 End With
and that is why you don't see it.
 
Last edited:
Upvote 0
Thank you both for your replies. They were both helpful.
With Kamolga's suggestion, at least there was a green border around the flat textbox that Fluff anticipated.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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
Back
Top