How to set focus on a button?

hi all,
i set default focus on button B in my form, but when you click somewhere (eg. click empty space on the web page), the focus just moves to the first button A on the page. (note: the button B i set to default focus is the second button on the page). how can i set focus on this  button B when you first drop your mouse on this page?

i tried to rearrange the tab index to set Button B as the first index but it does not work. and i also tried the following methods:
1. <form id="form1" runat="server" defaultfocus = "ButtonB">,
2. In page_load, set
protected void Page_Load(object sender, EventArgs e)
    {
              ButtonB.Focus();  
     }
3. In page_load, set
protected void Page_Load(object sender, EventArgs e)
    {
              Page.setFocus("ButtonB");  
     }
ALL the above methods work only when you first load the page, but when you FIRST click the page/drop your  mouse on that page, the focus moves to the BUTTON A. How to solve this problem? help!!!!

thanks a lot
viola
LVL 6
viola123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NullableCommented:
you can use a Panel Control and drop your buttons in it
then use DefaultButton property from Panel control and insert ID of the default Button

0
NullableCommented:
Attention !

other Controls that need Default Button such as Text boxes also need drop in to The Panel
0
viola123Author Commented:
hi,
thanks, i will try it now.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

viola123Author Commented:
hi,
it doesn't work, still do the same way as what i described.
0
NullableCommented:
you want that a Button be a default ? yea ?
this solution do this

u can Bold the font of the default button for user attention


0
viola123Author Commented:
hi, but this is not fit the business requirement
0
angus_young_acdcCommented:
You could create a mouse click event, and everytime that is fired have the focus set to your button.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
viola123Author Commented:
hi,angus_young_acdc:
thanks, that is a good idea.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.