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

  • Home
  • SEARCH
  • 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 148157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:54:30+00:00 2026-05-11T08:54:30+00:00

Follow up to this question: Winforms Style / UI Look and Feel Tips So

  • 0

Follow up to this question:

Winforms Style / UI Look and Feel Tips

So I have created my ‘base controls’ from which other controls inherit from. For testing, I am trying to change one of the base label’s font. But it is not propagating to the controls that inherit from it. On one of the forms, I can see the designer file is setting the properties for the control, so my base control’s properties are getting overridden.

On the base control’s I am using the Constructor to set the default properties. Should I be using a different event? If so, which one.

Here is the code for one of the base controls based on comment request…

Public Class InfoLabel     Inherits Label      Public Sub New()         ' This call is required by the Windows Form Designer.         InitializeComponent()          ' Add any initialization after the InitializeComponent() call.         Me.Font = New System.Drawing.Font('Tahoma', 14.25!)         Me.ForeColor = System.Drawing.Color.FromArgb(CType(CType(49, Byte), Integer), CType(CType(97, Byte), Integer), CType(CType(156, Byte), Integer))         Me.AutoSize = False      End Sub End Class 

The base controls show on the projects toolbox on the winform editor. Controls are then drag/drop from the toolbox.

  • 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. 2026-05-11T08:54:30+00:00Added an answer on May 11, 2026 at 8:54 am

    Your problem is your custom control’s InitializeComponent() method. I have no idea why that is there. You would get that method automatically if you were implementing a UserControl, but inheriting from a standard control that method should not be there. With your base class having an InitializeComponent() method and your subclass also having one, someone is overwriting someone else.

    I just subclassed a label in C#. I dragged this on my form and the font displayed as the new font, not the base (Label) class’s font.

    using System.Drawing; using System.Windows.Forms;  namespace WindowsFormsApplication1 {     public class MyLabel : Label     {         public MyLabel()         {             Font = new Font('Candara', 14);         }     } } 

    I then created a second label, called MySubLabel which inherited from the MyLabel class. When I changed the ForeColor on the MyLabel class, the MySubLabel automatically updated.

    So this should work.

    Caveat: in Visual Studio you need to recompile the assembly before trying to see updates in the designer.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Try this: RewriteRule (.*)/(.+) $1_$2 [NS] RewriteRule (.*) stuff/$1 [NS] May 11, 2026 at 12:18 pm
  • added an answer Create a check constraint that is bound to a user… May 11, 2026 at 12:18 pm
  • added an answer CustomValidator is meant to give you freedom to implement your… May 11, 2026 at 12:18 pm

Related Questions

In follow up to this question , it appears that some numbers cannot be
As a follow up to this question: Developing a online exam application, how do
As kind of a follow up to this question about prefixes , I agree
I have a barcode scanner (which acts like a keyboard) and of course I
I have a WinForms .NET app that, according to the Vista Task Manager with

Related Questions

In follow up to this question , it appears that some numbers cannot be
As a follow up to this question: Developing a online exam application, how do
As kind of a follow up to this question about prefixes , I agree
I have a barcode scanner (which acts like a keyboard) and of course I
I have a WinForms .NET app that, according to the Vista Task Manager with

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.