PC Review


Reply
Thread Tools Rate Thread

Focus problem

 
 
Michael Wong
Guest
Posts: n/a
 
      8th Dec 2003
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?


 
Reply With Quote
 
 
 
 
Michael Wong
Guest
Posts: n/a
 
      9th Dec 2003
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?
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus Problem =?Utf-8?B?TVBNMTEwMA==?= Microsoft Access Forms 0 16th Feb 2007 03:05 PM
Problem w. Focus() Robert Wachtel Microsoft Dot NET Compact Framework 2 1st Dec 2005 02:20 PM
RE: Focus problem. Microsoft C# .NET 0 31st Aug 2005 01:54 AM
Get Focus Problem Phil Lefter Microsoft Access Forms 0 29th May 2005 03:26 PM
Focus problem Jos Vens Microsoft Excel Programming 0 27th May 2004 11:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:54 PM.