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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:54:59+00:00 2026-05-29T05:54:59+00:00

I derived from a ToolStripComboBox in order to create one that encapsulates a percentage

  • 0

I derived from a ToolStripComboBox in order to create one that encapsulates a percentage picking dropdown. The goal is to have all of the validation and string parsing in the derived control. The parent simply receives an event when the percentage chosen has changed, and it can access a public integer for getting and setting the percentage.

The problem I have is that in the designer file for the parent control which I place my derived control on, it constantly keeps adding a full set of strings using the ComboBox.Items.AddRange method. In the constructor for my derived control I have the following:

foreach (int i in percentages)
{
    ComboBox.Items.Add(String.Format("{0}%", i));
}

Over time these values accumulate in the designer file many, many times over. I don’t know how to make the Items property hidden since it’s not virtual. I want to suppress this flooding of my designer file.

Example of my designer file:

this.zoom_cbo.Items.AddRange(new object[] {
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%",
"10%",
"25%",
"50%",
"75%",
"100%",
"150%",
"200%",
"300%",
"400%",
"600%",
"800%",
"1600%"});
  • 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-29T05:55:01+00:00Added an answer on May 29, 2026 at 5:55 am

    Since it’s a derived list that the user is just selecting from, try adding this to your derived combo box to prevent the serialization of the items:

    [Browsable(false)]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public new ObjectCollection Items
    {
      get { return ((ComboBox)this).Items; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom validation attribute derived from action filter attribute. Currently the attribute
I've known that if B is derived from A, then when I create a
I have a control derived from a CWnd object that has its custom implemented
I have a DesignerCanvas (derived from canvas) that I can add UIElements to, then
I have a class derived from HttpApplication that adds some extra features. I'm to
I have some questions derived from a problem that I have already solved through
I want to create a custom control derived from TPanel that contains an image
I have a class derived from CTreeCtrl . In OnCreate() I replace the default
I have a class derived from Dictionary. I need this class to simulate a
I have derived from a 3rd party class, and when I attempt to call

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.