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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:15:06+00:00 2026-05-24T11:15:06+00:00

Situation: I am making a Collapsible Panel. In my business situation, I am required

  • 0

Situation: I am making a Collapsible Panel. In my business situation, I am required to have the panel support the following:

  • A “direction” (ie, will it dock top, bottom, left, or right). This changes which direction it collapses and a few other things.

  • A “style”. There are some predefined visual styles for this product (defining background color, gradient or not, text color, hover color, etc).

Here’s the problem: certain styles are incompatible with certain directions. Here are the requirements:

  • There needs to be some way to prevent/warn the programmer if he/she coded the panel to have incompatible style and direction. For example, having the panel throw a runtime exception if they are incompatible will satisfy this requirement.

  • Not allow anyone to dynamically change either style or direction during runtime. If I need to, then I can allow it to be “dynamically” changed in InitializeComponent, but not anywhere else.

  • The panel needs to be visible in Design View. but not necessarily able to be dragged and dropped in design view, and technically I don’t need to even alter the attributes of the panel in design view. Though I obviously want either of those other things if possible.

One potential solution: Have the constructor take two inputs: a direction and a style. That way both the changes are treated as an atomic action. If they are not both changed at the same time, then between changing the direction/style and then changing the other, the panel will be in an inconsistent state. I want to avoid that.

How can I get the Design View to not use the default constructor and/or what are better practices for fulfilling the requirements?

Note

The Panel is only an example and a use case to ask the broader question. I want this post to answer the direct question on the best practices for getting the Design View to handle my requirements. If the Visual Studio supports injecting a non-default constructor in InitializeComponent, then I want to know how (and any caveats with that). If there are better practices which fulfill the listed requirements, then I would like to know that as well.

  • 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-24T11:15:07+00:00Added an answer on May 24, 2026 at 11:15 am

    Add support for the ISupportInitialize interface which the designer can use to set all the properties and tell you when it’s finsihed.

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

Sidebar

Related Questions

I'm making a big C project and I have never come across a situation
For a game I'm making I have a situation where I have a list
I'm making my android application. And I want to have something like this situation:every
I have a situation where I am making ajax requests to a server from
CSS Float is making me crazy, can any one explain the following situation? How
I am in the situation where I have been charged with making an application
I have the following situation: class Worker { public Integer somework() { Integer k=0;
I really have a strange situation. I'm making a Linux multi-threaded C application using
The situation is following. I have a local (development) PHP server (Win + IIS)
Here is the situation: I am making a small prog to parse server log

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.