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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:14:33+00:00 2026-06-14T21:14:33+00:00

I have an inherited form and use it as a setting form. I ask

  • 0

I have an inherited form and use it as a setting form. I ask user to input name to store, I want to change form title (text property of forms) dynamically according to the input data. but if I change base form title, overflow occur. also I create FormTitle property in base form to save current form name.

for example my application name is SerenaIR and I want to show below style for all of my forms.

SerenaIR | storename | formname
ex: SerenaIR | SuperMarket | Sale

FormTitle Property

    private string _frmTitle;
    /// <summary>
    /// current form title for showing on title bar.
    /// </summary>
    [Category("JSCustomizer"),
     Description("The text that is displayed on form title bar.")]
    public string FormTitle
    {
        get { return _frmTitle; }
        set
        {
            try
            {
                _frmTitle = value;
                Invalidate();
                var appPreName = Properties.Settings.Default.AppNamePre + @" " + Properties.Settings.Default.AppName;

                if(_frmTitle.Length < 3)
                {
                    base.Text = appPreName;
                }
                else
                {
                    base.Text = appPreName + @" | " + _frmTitle;
                }
            }
            catch
            {
                return;
            }
        }
    }

in setting form i save setting about store name and on the base form when i want change the title by below code, all of Inherited form raise error!

    private void JSfrmBaseLoad(object sender, EventArgs e)
    {
            Text = Properties.Settings.Default.AppNamePre + @" " + Properties.Settings.Default.AppName;
    }
  • 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-06-14T21:14:34+00:00Added an answer on June 14, 2026 at 9:14 pm

    My guess is that you are creating and endless loop that causes the overflow. But I think the real problem is that you are misunderstanding how inheritance works in this scenario. Changing a non-static property value on a base form will not update the value for inheriting forms because each form is a new instance.

    My suggestion is to use a property in Program.cs to store the form title. In this example I am changing the form title on a button click. All forms that inherit Form1 will set the new form title in OnLoad.

    Program.cs:

    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            FormTitle = Properties.Settings.Default.FormTitle;
    
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    
        public static string FormTitle { get; set; }
    }
    

    Form1:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    
        protected override void OnLoad(EventArgs e)
        {
            Text = Program.FormTitle;
            base.OnLoad(e);
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
            Program.FormTitle = "new form title";
            Text = Program.FormTitle;
            new Form2().Show();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited a project, that provides an order form to a customer. The
I have a winforms form which is inherited from another form. e.g. class StartForm
I have made a Base Form which is inherited by most Forms in the
I have the following code (inherited from someone): <div class=feedback>&nbsp;</div> <form onsubmit=return false autocomplete=off>
We have inherited an application (Java-based, running on WebLogic 10.3.5) that makes extensive use
I have a form contains text fields,a textView and 2 switches.Now I am using
For customized use, I have inherited std::vector to a custom class Vector . For
I have a property ProductName in my Form. I am getting warning while compiling
I have inherited a system which seemingly requires me to use a cursor or
I have inserted this form with multiple checkbox items which collects some values, What

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.