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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:42:09+00:00 2026-06-04T00:42:09+00:00

I am working on a C# – Winforms application and attempting to set the

  • 0

I am working on a C# – Winforms application and attempting to set the background colour of a read-only text box like so…

txtMyBox.BackColor = Color.FromName ("Red");

This is failing with the error message…

System.ArgumentException was unhandled
Message=Control does not support transparent background colors.
Source=System.Windows.Forms

First things first; is this the right way to set the background colour for a read-only textbox? I’m doing this a lot for ordinary textboxes and it appears to work fine.

If it is, could someone help me out with what a “transparent background color” is, and why I should want one? I don’t think I do; I just want the background to change colour.

  • 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-04T00:42:11+00:00Added an answer on June 4, 2026 at 12:42 am

    A better way would be:

    txtMyBox.BackColor = Color.Red;
    

    The error you getting is being caused because of somewhere else in your code where you are trying to set the background color of the form itself to be transparent and that is not supported, check your code carefully and you will find somthing like that:

    BackColor = Color.Transparent;
    

    Since there is no element name (i.e. myControl.BackColor = somthing) and your sentence start with BackColor = somthing – the compiler thinks you want to change the background color of the windows form into being transparent, check your form editor too – you might doing that from there.

    Here is a reproduction of your error:

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            BackColor = Color.Transparent; //Control does not support transparent background colors.
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with Json, how can I NSlog only the title in this code: NSDictionary
Working on a web based buying and selling application with PHP MySQL where users
Working on a console application using Delphi 7, and have run into a problem.
Working on a legacy application at the moment and we are replacing the data
Working with TCL and I'd like to implement something like the Strategy Pattern .
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
Working on a project where a sequential set of methods must be run every
Working on a new way of using an already existing searchengine in an application.
Working on a mobile application using jquery mobile and phonegap framework. My question is
Working with a website (as opposed to a web application) in VS2010 so there

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.