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 6964579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:56:33+00:00 2026-05-27T15:56:33+00:00

I am writing a custom control deriving from UserControl . In it are some

  • 0

I am writing a custom control deriving from UserControl. In it are some controls that I want to prevent from being accessible (some textboxes, comboboxes). They are to become available for interacting only when the user clicks an ‘Edit’ button.

I read about KeyPreview but it is only available for forms. I find redirecting all the events to a common handler that checks if editing mode is enabled too much of a hassle.

Is there any way to put another transparent control over the others (Z orderwise), that will intercept all mouse and keypress events but renders the controls normally? Or maybe there is a different solution?

Edit:
I want to receive mouse events on the control that covers the others. I need those for Drag and drop and moving the custom control.

  • 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-27T15:56:34+00:00Added an answer on May 27, 2026 at 3:56 pm

    You can write your’s Enabled property in your UserControl and use it.

    private new bool Enabled
            {
                get { return _enabled; }
                set
                {
                    foreach (System.Windows.Forms.Control c in this.Controls)
                    {
                        if (c is SomeTypeThatShouldBeExcluded)
                            continue;
                        c.Enabled = value;
                    }
                    _enabled = value;
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a custom control derived from System.Windows.Forms.Control . The control is using the
I'm writing a custom compound control that extends RelativeLayout. Inside this component, there is
I am writing a custom control based on RichTextBox that needs the ability to
I'm writing a custom control and I'd like the control to switch from an
I'm writing a small ASP.Net custom control inheriting from CompositeControl. The control is just
I am writing a custom control that is a ListView that has a CheckBox
I'm writing some custom behavior for a ToolStripDropDown control. I'd also like to modify
I'm writing a custom server control inherited from ListControl. I'm able to change the
I'm writing php and I have a custom made control that is Grid and
I'm writing a custom control and I want to add a MessageText property of

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.