Link to home
Start Free TrialLog in
Avatar of ekey11
ekey11

asked on

Transparent TextBox in C#

dear all:
   How can realize transparent TextBox in C#?

 THS!
 ekey11
Avatar of Fahad Mukhtar
Fahad Mukhtar
Flag of Pakistan image

Avatar of ekey11
ekey11

ASKER

hi,
thanks

I need TextBox Control transparent , not others, and i need code or method .

THS
<asp:TextBox id="TextBox1" runat="server" BackColor="Transparent" BorderStyle="None" BorderColor="Transparent">afdasdf</asp:TextBox>
If you're using Microsoft Visual C# .NET,

1) right click TextBox - Properties
2) BackColor - Web - Transparent
3) BorderColor - Web - Transparent
4) BorderStyle - None
It can be done to most control eg. Buttons.
Avatar of ekey11

ASKER

1) right click TextBox - Properties  
2) BackColor - Web - Transparent   - nullity
3) BorderColor - Web - Transparent - no Properties  
4) BorderStyle - None
try this:

textBox1.BackColor = this.BackColor ;
textBox1.BorderStyle = BorderStyle.None;
Avatar of ekey11

ASKER

i tried it . if Form's back has a picture ,not work!!
this question is not easy.
It works for me... Strange...
I enough have a background picture on the form.
Avatar of ekey11

ASKER

do you sure in C#???
*-*
Yap. I'm sure. I only use C# for .Net
<%@ Page language="c#" Codebehind="filename.aspx.cs" AutoEventWireup="True" Inherits="proj.filename" codePage="1200" smartNavigation="True" enableViewState="True"%>
Avatar of ekey11

ASKER

can you offer your code?
THS
ASKER CERTIFIED SOLUTION
Avatar of WiB
WiB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
TextBox doesn't support transparent background colors.
You have to write your own TextBox control
BTW, you may also try to assign BackColor property of TextBox the BackColor property of your form.
It should work
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For example, you may insert the line

this.textBox1.BackColor = this.BackColor;

after you assign picture to BackColor property of your form.