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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:51:11+00:00 2026-05-17T17:51:11+00:00

I am using .Net (C#, WinForms, Linq to SQL, SQL Server 2008) to develop

  • 0

I am using .Net (C#, WinForms, Linq to SQL, SQL Server 2008) to develop a new line-of-business application that will replace a crufty old Foxpro application. I did not write the old app, but do provide support for it, and I am the in-house developer for the new app.

One of the design decisions that was made years ago with the Foxpro app was to force all entered text to be uppercase. This was to ensure that all text has a uniform format for sales reports, mailing lists, etc.

A current topic of conversation between me and some of the users, is whether this should be continued in the new app. It looks likely that it will be continued.

My question is, what is the best strategy to make this happen, involving the least amount of my time as possible?

It feels like a real drag to always have to remember to set the CharacterCasing property of every. single. textbox. that I drop onto a form. And it appears that DataGridViews don’t even have a simple property to set; you have manually handle CellChanged events, etc.

How would you do it?

  • 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-17T17:51:11+00:00Added an answer on May 17, 2026 at 5:51 pm

    Thanks to all who contributed. I thought digEmAll in particular had the best answer. However, I am posting my full implementation as the answer, in order to benefit others who find this questions.

    UpperCaseTextBox implementation:

    public class UpperCaseTextBox : TextBox
    {
        public UpperCaseTextBox()
            : base()
        {
            base.CharacterCasing = this.CharacterCasing;
        }
    
        private CharacterCasing _characterCasing = CharacterCasing.Upper;
        [DefaultValue(CharacterCasing.Upper)]
        public new CharacterCasing CharacterCasing
        {
            get
            {
                return _characterCasing;
            }
            set
            {
                base.CharacterCasing = value;
                _characterCasing = value;
            }
        }
    }
    

    UpperCaseDataGridView implementation:

    public class UpperCaseDataGridView : DataGridView
    {
        private CharacterCasing _textBoxCharacterCasing = CharacterCasing.Upper;
        [CategoryAttribute("Behavior")]
        [DescriptionAttribute("Sets CharacterCasing of all contained TextBox controls.")]
        [DefaultValue(CharacterCasing.Upper)]
        public CharacterCasing TextBoxCharacterCasing
        {
            get
            {
                return _textBoxCharacterCasing;
            }
            set
            {
                _textBoxCharacterCasing = value;
            }
        }
    
        protected override void OnEditingControlShowing(DataGridViewEditingControlShowingEventArgs e)
        {
            var txtBox = EditingControl as TextBox;
            if (txtBox != null)
                txtBox.CharacterCasing = this.TextBoxCharacterCasing;
    
            base.OnEditingControlShowing(e);
        }
    }
    

    One could implement this functionality using less code than the above, however, I purposely aimed for a flexible, robust implementation that plays nice with the Properties window, allows me to override the uppercasing in instances where needed without having to tear out the control and replace with vanilla control, etc.

    Thanks again to all who contributed.

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

Sidebar

Related Questions

I am a Winforms and business engine developer who is using asp.net for the
I am using VB.Net WinForms. I would like to call the Adobe Reader 9
I'm using a RichTextBox (.NET WinForms 3.5) and would like to override some of
I've been using Winforms since .NET 1.1 and I want to start learning WPF.
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
(Using WinForms and C#. -> .Net 2.0) I am adding nodes to a TreeView
Using c#, VS2005, and .NET 2.0. (XP 32 bit) This is a Winforms app
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
Using .Net (C#), how can you work with USB devices? How can you detect

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.