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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:20:59+00:00 2026-05-27T12:20:59+00:00

My current project requires me to disable combo boxes from Form 2 when edit

  • 0

My current project requires me to disable combo boxes from Form 2 when edit button is clicked in Form 1. What I would like to know is how I can disable a combo box that’s in Form 2 from Form 1.

I tried

 IDComboBox4.Enabled = false; 

in Form 1 however I get and error that says

“The Name ‘IDComboBox4’ does not exist in the current context”.

Update:

I attempted both answers however sadly neither worked. Now I get a syntax error

“An object reference is required for the non-static field, method, or property”

when trying code

    dlgForm.ComboBox4Enabled = false;

in Form1 with code

    public bool ComboBox4Enabled
    {
        get 
        { 
            return IDComboBox4.Enabled; 
        }
        set 
        {
            IDComboBox4.Enabled = value; 
        }
    }

in Form2 which is also dlgForm. I feel like I’m overlooking something basic however just cant put my finger on it at the moment. If you would like some snippets of my code let me know. Any help is appreciated. Thanks again.

  • 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-27T12:20:59+00:00Added an answer on May 27, 2026 at 12:20 pm

    You could just make IDComboBox4 public and use form2.IDComboBox4.Enabled = false; if you like but I would STRONGLY suggest you create a property on form 2 that allows you to do it without accessing the internals of form2. Something like this:

    public bool ComboBox4Enabled{
      get{return IDComboBox4.Enabled;}
      set{IDComboBox4.Enabled = value;}
    }
    

    Then use form2.ComboBox4Enabled = false; to set it.

    Whilst you’re at it – you really should rename your comboboxes etc. so that they make sense for the next developer who comes along. _cbbJobTitle or something.

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

Sidebar

Related Questions

I am hosting SpiderMonkey in a current project and would like to have template
One of the data structures in my current project requires that I store lists
I have a spec in my current project that requires us to advise the
My current project is in Rails. Coming from a Symfony (PHP) and Django (Python)
My current project requires extensive use of bit fields. I found a simple, functional
My current project requires me to assemble a .zip file containing HTML and text-only
My current project requires locating an array of strings within an element's text content,
I've never worked with Database Functions, but my current project requires it. I need
I'm currently working on a python project, that requires file transmission from a client
The current project I'm working requires me to follow certain procedures to eliminate whitespace

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.