Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3699316
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:05:17+00:00 2026-05-19T05:05:17+00:00

In my C# WinForms program, I have a form that has only a single

  • 0

In my C# WinForms program, I have a form that has only a single Button control on it.
By default, that Button control receives the focus on the form. But I don’t want the Button to ever get focus.

Is there a solution, even one that would require a call to an unmanaged API?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:05:17+00:00Added an answer on May 19, 2026 at 5:05 am

    In your form Load event you can set the focus on some other control.

    If you do not want the control to ever get focus via keyboard, you can also set its TabStop property to false.

    If you want that the button should not have focus when you open the form, then you need to correct the TabIndex property. The TabIndex property has an integer as value which specifies the order in which the controls get focus when tab key is pressed. If the control has TabIndex set to 0 then change it to some other value.

    Check the documentation for TabIndex and TabStop properties on MSDN.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In WinForms, I can design a form and have a TabValue to control which
I have written a WinForms program in C#.Net to click a button programmatically within
I have written a WinForms program in C# and left the default font for
How can I have a WinForms program do some specific thing whenever a certain
I have a program that when it starts, opens a winform (it is the
My WinForms application has a tab with a System.Windows.Forms.WebBrowser control. There are several controls
The WinForms TextBox has an 'Undo' command but has not a 'Redo' command -
I have a test winforms app with ThreadExceptionHandler that displays a message box when
I have a winform data entry and retrieval program called CaseNotes. This has a
This is a C# winforms app. Preface: I am creating a form that will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.