skip to Main Content

I’ve made a custom textbox in Photoshop, and I want to apply it. I know, that you can’t change the background in Visual Studio, or make it transparent. I’ve seen a few methods on how to do it, but they weren’t very clear.

So I want to ask you – what is the esiest way to change the background of a textbox or make it transparent?

2

Answers


  1. Not sure about transparency, but changing the background of a text box is simple, check this link:

    XAML:
    http://www.c-sharpcorner.com/UploadFile/mahesh/XAMLTextBox04092007062405AM/XAMLTextBox.aspx

    Also, if working on WinForms; you have the BackColor property that works in the same way:
    http://msdn.microsoft.com/en-us/library/s2kh9x59(v=vs.110).aspx

    EDIT:

    You can do it by using a richtextbox instead… kind of.

    http://www.codeproject.com/Articles/4544/Insert-Plain-Text-and-Images-into-RichTextBox-at-R
    http://www.codeproject.com/Articles/12135/Inserting-images-into-a-RichTextBox-control-the-OL

    Login or Signup to reply.
  2. You need to Add a new user control , say CustomTextBox and Put this inside the constructor, which will make it transparent

    SetStyle(ControlStyles.SupportsTransparentBackColor, true);
    

    C# transparency on textbox

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search