Disallow focus on form controls

  • Thread starter Thread starter brianbasquille
  • Start date Start date
B

brianbasquille

Hello all,

Would like to disallow the ability for controls on my form to get
focus?

Working mainly with a menu system and GDI+ and i would like the user to
use the mouse for most operations. But focus still remains on my first
object (a drop-down box) when i load the form.

Pretty simple request i'd assume.

Thanks in advance,

Brian
 
Have you tried simply responding to the Leave event of the dropdown and
refocusing that control?

This works fine except that if you use TextBox or other controls that
require key input they never get the focus.

private void comboBox1_Leave(object sender, System.EventArgs e)

{

this.comboBox1.Focus();

}


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top