drink_sangiovese[ at ]yahoo.com wrote:
[Quoted Text] > I have a user form in my application (VBA under ArcGIS) that has 20 or > so checkboxes. The code for my form determines if the various check > boxes will be enabled or not when the form loads, based on a value I > acquired before loading the form. It's all working fine, although when > I load it the first enabled checkbox gets the focus and has that thin > dashed line around it. I would rather not have the focus on any check > box, or on any other object on my form, when I load the form. How do I > do this? How do I load a focus-free form?
Here's a quick and dirty way. Put an empty Frame control on the UserForm, then add code like this to move it out sight:
Private Sub UserForm_Initialize() Frame1.Move -2 * Frame1.Width Frame1.SetFocus End Sub
And this, to transfer focus (appropriately) if the user tabs to it:
Private Sub Frame1_Enter() If Me.Visible Then CheckBox1.SetFocus End Sub
Later... Karl -- Working without a .NET? http://classicvb.org/
|