Results 1 to 5 of 5

Thread: Transparent TextBox

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Brisbane, Australia
    Posts
    34

    Transparent TextBox

    Hi All,

    I need to have transparent textboxes. I thought it would be as simple as inheriting TextBox and putting the following code in the constructor:-
    setstyle(ControlStyles.SupportsTransparentBackColor, True)

    The textbox now certainly allows me to set the backcolor to transparent, but unfortunately it always displays as white when I do.

    Any clues?

    Alan Liddle

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    as far as I know, you cant have a transparent control
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Brisbane, Australia
    Posts
    34

    Yes you can

    I have alread created a transparent label and a few other usercontrols. Documentation suggests that by simply inheriting and setting the Style correctly it will work. If I don't set the SetStyle and try to set the background color to transparent it generates an error. The the style set it doesn't.

    Alan

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Umm I mean can you see what's under the control?
    if you put your transparent textbox on top of a command button, can you see the command button under the textbox?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Brisbane, Australia
    Posts
    34
    Yep! At least that is what happens with our label and other controls. But we designed them from the ground up (Inherited from UserControl). The textbox control I have has been inherited from TextBox.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width