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.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

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