Focus on spin button creates boxes around arrows

wddnld

Board Regular
Joined
Jul 14, 2008
Messages
51
I am using a spin button control on a form that changes a value in a text box. After it is spun up or down, the control retains focus and puts a box around both the up and down arrows.

It is the same issue mentioned here:
http://www.xtremevbtalk.com/showthread.php?t=291951

The solution listed at this link is to set focus to the text box, as in:
Code:
Sub spnValue_SpinDown()
[INDENT]TextBox1.Value = TextBox1.Value - 1
TextBox1.SetFocus
[/INDENT]End Sub
 
Sub spnValue_SpinUp()
[INDENT]TextBox1.Value = TextBox1.Value + 1
TextBox1.SetFocus
[/INDENT]End Sub

However, I can't get that to work consistently for me. When I use the spin button once, it works once, i.e., you click the spin button up or down and the boxes don't show up. But, on the second press, the boxes show up, and then they continue to appear and disappear each time you click the control.

Any ideas why? It's a minor issue, but it seems like it's close to working.
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,612
Members
414,080
Latest member
penguin23

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