Transparent Textboxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 boxes be transparent? How do
I fix this?
 
Hi Cadel,

Generally, the user control will not be transparent. Could you show us the
code that you implement your textbox class, and give us a simple example to
reproduce this issue?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
class ClassTextBox : System.Windows.Forms.TextBox
{
protected override void OnEnter(System.EventArgs e)
{
base.OnEnter(e);
SelectAll();
}

}

class ClassTextBoxNum : System.Windows.Forms.TextBox
{

protected override void OnEnter(System.EventArgs e)
{
base.OnEnter(e);
SelectAll();
}

protected override void OnKeyPress(KeyPressEventArgs e)
{
if (!Char.IsDigit(e.KeyChar) && !Char.IsControl(e.KeyChar))
{
e.Handled = true;
}
base.OnKeyPress(e);
}
 
Hi Cadel,

With this code snippet, it still works fine on my machine. The TextBoxes
are visible. Please try to post in the
microsoft.public.dotnet.framework.windowsforms.controls newsgroup.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top