471,325 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

transparent label over textbox

Hi,
I'd like to put a transparent label over a textbox. I set the label
backcolor to transparent, and set its parent as the textbox. But setting the
textbox as the parent resulted in the label not showing up at all (I changed
the backcolor to a color to see if it would show up). Anyone know what to do?
Thanks!!!
Mel
Feb 2 '06 #1
3 6404
Mel,

Instead of doing this, why not custom paint the textbox?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"melanieab" <me*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Hi,
I'd like to put a transparent label over a textbox. I set the label
backcolor to transparent, and set its parent as the textbox. But setting
the
textbox as the parent resulted in the label not showing up at all (I
changed
the backcolor to a color to see if it would show up). Anyone know what to
do?
Thanks!!!
Mel

Feb 2 '06 #2
What I'm trying to do is:
I have the textbox, and it's set at read-only. But you can still have the
mouse enter and the cursor blink in it. I want it so that the user can't
enter the textbox at all without having to disable it (and change its color).
Also, I've tried replacing the textbox with a label, but the text color
isn't as vibrant as with a textbox (I'm being picky here). I was just hoping
you could set the transparent label's parent to anything, and it would work
just the same as when the parent is a picturebox. In the meantime now, I've
tried the same thing with a textbox (putting a transparent textbox over the
other textbox) and it reacts the same as the label.
Any way to get this textbox so that it's not enterable?
Thanks again!!!
Mel
Feb 2 '06 #3
melanieab schrieb:
What I'm trying to do is:
I have the textbox, and it's set at read-only. But you can still have the
mouse enter and the cursor blink in it. I want it so that the user can't
enter the textbox at all without having to disable it (and change its color).


Maybe this will work for you?

Implement the "Enter"-Event of your TextBox:

private void textBox1_Enter(object sender, EventArgs e)
{
SelectNextControl(this, true, true, true, true);
}
Feb 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by larry | last post: by
3 posts views Thread by SStory | last post: by
4 posts views Thread by jcrouse | last post: by
2 posts views Thread by Martin | last post: by
3 posts views Thread by bulwark_jrm | last post: by
3 posts views Thread by vul | last post: by
8 posts views Thread by MikeB | last post: by
reply views Thread by rosydwin | last post: by

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.