473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

transparent textboxes - quick question

Hi,
I found this online:
"If the SupportsTransparentBackColor bit is set to true, and the BackColor
is set to a color whose alpha component is less than 255, OnPaintBackground
will simulate transparency by asking its parent control to paint the
background."

What I've tried to do is this:
On the main form declared private TbJob tbJob (this is the textbox), as well
as set tbJob.Parent = pbEBS; (the picturebox I want as the background). Then
there's:
public class TbJob:TextBox
{
protected override void OnPaintBackground(PaintEventArgs e)
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint,t rue);
this.SetStyle(ControlStyles.DoubleBuffer,true);
this.SetStyle(ControlStyles.UserPaint,true);
this.SetStyle(ControlStyles.SupportsTransparentBac kColor,true);
this.BackColor = Color.FromArgb(0,255,0,0);
}
}

I've set all the things that the online help says to set, and I can't figure
out what I'm missing.

Thanks very much for any help!
Melanie
Nov 17 '05 #1
1 1495
Melanie:

I'm afraid that I have bad news for you. The textbox control that you get
with the .Net runtime does not support transparency -- even if you alter the
create params to configure transparency. You're going to have find a
third-party control that does.
"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
Hi,
I found this online:
"If the SupportsTransparentBackColor bit is set to true, and the BackColor
is set to a color whose alpha component is less than 255,
OnPaintBackground
will simulate transparency by asking its parent control to paint the
background."

What I've tried to do is this:
On the main form declared private TbJob tbJob (this is the textbox), as
well
as set tbJob.Parent = pbEBS; (the picturebox I want as the background).
Then
there's:
public class TbJob:TextBox
{
protected override void OnPaintBackground(PaintEventArgs e)
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint,t rue);
this.SetStyle(ControlStyles.DoubleBuffer,true);
this.SetStyle(ControlStyles.UserPaint,true);
this.SetStyle(ControlStyles.SupportsTransparentBac kColor,true);
this.BackColor = Color.FromArgb(0,255,0,0);
}
}

I've set all the things that the online help says to set, and I can't
figure
out what I'm missing.

Thanks very much for any help!
Melanie

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: noggy | last post by:
Hi I am new so thanks for reading. I have just made a quick html file that is to be integrated into my companies Active desktop. Now this works fine and everyone can have this now as a background...
2
by: Steve Barnett | last post by:
I've got a form on which there is a picture box with a picture in it. On top of that I place two labels and make their backgrounds transparent. What I expect to see is the picture showing through...
3
by: melanieab | last post by:
Hi again, Just wondering if this was possible. I tried setting it in the Properties menu but got this response: This control does not support transparent background colors. Thanks again, Melanie
3
by: Steve Koon | last post by:
Any thoughts on getting this project to work or suggesting another method would be appreciated. Steve ========================================== Project: A Windows Form which acts as a...
4
by: Mike L | last post by:
This is for a Win form. After creating my new Textbox Class, all my instances of my new Textbox Class are transparent. My textbox class inherits System.Windows.Forms.TextBox, why would my text...
11
by: 2D Rick | last post by:
I want to do a quick check of a group of textboxes only to see if they contain anything. I tried this code but it appears to go from box to box based on the boxes time of creation. Is it...
5
by: Mark Deibert | last post by:
I'm a former VB6 coder. Quit a few years ago. Now I'm back and trying to teach myself VB.NET. I don't remember having this much difficulty learning VB6. I'm totally stuck on something and need your...
4
by: Brian Henry | last post by:
I have an icon I want to draw onto the screen, but I want to streatch it out to be about 256x256 and make it about 75% transparent how would I go about this? do i need to convert it to a bitmap...
3
by: Scott | last post by:
Is there a way to make a control have a transparent background? Like a text box. Thanks, Scott
1
by: Aleksey | last post by:
Hi, guys! How can I make ListView to be transparent? Thanks a lot
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.