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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:50:26+00:00 2026-05-11T23:50:26+00:00

I made a custom control that is basically a multiline TextBox that allows input,

  • 0

I made a custom control that is basically a multiline TextBox that allows input, and some other controls on the side that report some information. Now, I wanted to allow the user of my control to change the font in the TextBox, and thought something along the lines of: “Well, the user shouldn’t be able to change the font of other controls, so I’ll link it through the Font property on the control”, and hence ended up with the following code:

public override Font Font {
    get { return txtEntry.Font; }
    set { txtEntry.Font = value; }
}

(Yes, hungarian notation on my controls… Old VB habits die hard…)

Now, this would appear fine, except that when I built my project and went back to my form to see the effect, Visual Studio crashed. And crashed reliably when starting the project back up again… I opened the class in Notepad and changed it to a different name, deleted the output folders and opened Visual Studio, rebuilt, and it’s all working fine now.

My question is this: is there some inherant design flaw in my idea, or is this purely a VS bug?

  • 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-11T23:50:26+00:00Added an answer on May 11, 2026 at 11:50 pm

    Font is an ambient property. This means that, if it is not set, the control looks at the parent’s property to get its value. So, you have a recursive function because the parent’s Font property looks at the child’s, and around we go.

    Windows forms controls use ambient properties, so child controls can appear like their surrounding environment. In this context, "ambient" means that the property is, by default, retrieved from the parent control. If the control does not have a parent and the property is not set, the control tries to determine the value of the ambient property through the Site property.

    If the control is not sited, if the site does not support ambient properties, or if the property is not set on the AmbientProperties object, the control uses its own default values. Typically, an ambient property represents a characteristic of a control, such as BackColor, that is communicated to a child control. For example, by default a button will have the same BackColor as its parent form.

    BTW, don’t feel bad; I asked the exact same question once 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 168k
  • Answers 168k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may need to set the autoresizing properties, i.e. myView.autoresizingMask… May 12, 2026 at 1:42 pm
  • Editorial Team
    Editorial Team added an answer Why not a simple onSubmit? <form method="post" id="myForm" action="dynaform.php" onSubmit="alert('Thank… May 12, 2026 at 1:42 pm
  • Editorial Team
    Editorial Team added an answer Try this: <object type="application/x-shockwave-flash" data="VID_URL" width="425" height="344"> <param name="movie" value="VID_URL"… May 12, 2026 at 1:42 pm

Related Questions

Background I am trying to create a copy of a business object I have
Probably a long question for a simple solution, but here goes... I have a
we are currently developing a couple of custom asp.net server controls. Now we'd like
I have used the following article as a guide to creating a custom EditorPart

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.