0

I'm working on a project and I need to set the BackColor of my textboxes to Transparent. I know I should paste some code in the "constructor", but I don't know where I can find it. I'd really appreciate someone explaining everything in detail, I'm pretty new to winforms.

This Question is different from other questions because I'm looking for better explanation.

This is what I wanted to do in my code:

        textBox1.Visible = false;
        textBox1.BorderStyle = BorderStyle.None;
        textBox1.Text = "Nexuspractice";
        //textBox1.BackColor = Color.Transparent;
        textBox2.Visible = false;
        textBox2.BorderStyle = BorderStyle.None;
        textBox2.Text = "Confusionpractice";
        //textBox2.BackColor = Color.Transparent;

Commented sections don't work, because transparent BackColors are not allowed by default. I hope someone could make a good guide on how to allow it, I'm sure it'd be helpful for other people with this problem.

DutchJelly
  • 59
  • 6
  • I did see that post, but I don't know what usercontrol even is, that's where I'm stuck. – DutchJelly Mar 02 '17 at 17:34
  • I can't find the designer.cs file, could someone tell me where it's located? Answer: I found it by doubleclicking on the builderror. – DutchJelly Mar 02 '17 at 17:43
  • 1
    _I don't know what usercontrol even is_ and _I can't find the designer.cs file_ - You really ought to learn the basics instead of insisting on a task that is both really __hard__ as it involves tweaking a __legacy__ control to do things it was never meant to do and also pretty much __useless__. Users won't like to see through the text they enter! – TaW Mar 02 '17 at 17:46
  • I'm working on a project that really needs it, I did complete the steps of the guide you linked me, but I'm still getting errors. One of the errors is: "CustomTextBow does not contain a definition for AutoScaleDimensions." Could you help me fix this? Also: I'm not using textboxes to enter stuff, it's pretty much the output of the program. – DutchJelly Mar 02 '17 at 17:57
  • If you __don't__ want to use the `TexBoxes` for user __input__ you should use __`Labels` instead__. They love to sit on top of other controls, displaying a nice __transparent background__!! No extra efforts needed at all.. If necessary I would overlay a TextBox for entering data and then hide it and transfer the text to the Label. – TaW Mar 02 '17 at 18:58

0 Answers0