Ok, I found a solution from a previous search in Google:
myTextBox.Select();
"Michael Wong" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On the form, I have a textbox in which users provide information to filter
a
> datagrid.
> The problem I have is when I move around (horizontally and vertically) in
> the datagrid,
> the textbox seems to receive focus and repaints itself before focusing
back
> to the datagrid.
>
> The only workaround I found is to have Tabstop = False for the textbox,
but
> then I cannot have
> it initially focused when the form displays for the first time.
>
> I tried setting the focus to the textbox in the form constructor and in
the
> form load event but
> both doesn't work: Focus() returned false.
>
> What have I done wrong?
>
>
|