views:

179

answers:

3

Ok so I add all these text boxes on an unbound form, and everytime you open a form, it sort of jumps to the first text box so you can enter some information into it.

How do I get rid of that, because I do not want it to auto jump to the first text box when the form opens...i do not want it to jump to any text box when the form open at all.

thanks

+5  A: 

You will have to decide where you do want it to go, because it has to go somewhere. You can control where will tab order, set focus, and autotab.

I have just checked, and the best thing to do is to set the textboxes Enabled property to No and the Locked property to Yes.

Remou
can i make it jump to something that is not visible or is transparent? because this is more like a dashboard form where i just use text boxes to display some of the individual results....there is no entry on the form.
Justin
I have added a note.
Remou
thanks Remou...i see what you are saying and this is actually the way for me to go since I do not want to use any of the text boxes like regular text boxes. thanks
Justin
@Remou: follow-up...this worked perfectly. The idea of these forms were dashboards for display only and not entry. Thanks again!
Justin
Good :) char char
Remou
+1  A: 

If I read your question correctly it seems that you do not want any of your textboxes on the form to have the focus on opening the form.

What you need to do in this instance is to create a new unbound textbox on your form, and then make this unbound the first item in the form's tab order. Then resize the unbound textbox to 0 height and 0 width, making it invisible.

Istari
that did the trick...thanks!
Justin
I think you will find that this leads to a blinking spot, please see my answer for an alternative.
Remou
I wasn't sure from the OP whether the textboxes would be ever be navigable (perhaps by mouse) hence didn't suggest disabling and locking. The 'unbound' should have been a clue though:).Being as the textboxes are used just to to display text, your way is definitely better
Istari
+2  A: 

The default behavior is of course for the cursor to move into the first control that you’ve set up in the tab order.

Assuming you still want some sensible tab order in the form, then place a zero length text box in the forms headder. Remove the tab stop setting (other tab in property sheet). You might as well set this box transparent also.

Then in the forms on-load event, simply go:

  Me.NameOfTextBoxinFormsHedaing.SetFocus
Albert D. Kallal
cool thanks for the idea!
Justin
I think a transparent command button with no events would be better.
David-W-Fenton