Results 1 to 7 of 7

Thread: [VB6] - Hide textbox(or other control) backcolor

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    [VB6] - Hide textbox(or other control) backcolor

    can i hide the textbox(or picturebox) backcolor?
    (it's a question that normaly i found the code for a form)
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    Re: [VB6] - Hide textbox(or other control) backcolor

    May be by setting the control's transparency key to the color, but I believe it only works on forms. Problem is that Windows doesn't use the Alpha component of colors when drawing...
    It can be done if you add the picturebox to a form, with as backcolor an unused color (like pink) and give the form a transparency key of that color. Then you make sure this form stays on top of your main form (as if it is a control) by handling the position/sizechanged events of the main form.

    The best solution is a custom control, but for a textbox this can take a while.

    If you want multiple controls to have this, simply make one top-layer form which contains the controls (and see-through spots) with a background form having the background to display. (like an image of some sort)

    No API is involved here though.

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: [VB6] - Hide textbox(or other control) backcolor

    Quote Originally Posted by bergerkiller View Post
    May be by setting the control's transparency key to the color, but I believe it only works on forms. Problem is that Windows doesn't use the Alpha component of colors when drawing...
    It can be done if you add the picturebox to a form, with as backcolor an unused color (like pink) and give the form a transparency key of that color. Then you make sure this form stays on top of your main form (as if it is a control) by handling the position/sizechanged events of the main form.

    The best solution is a custom control, but for a textbox this can take a while.

    If you want multiple controls to have this, simply make one top-layer form which contains the controls (and see-through spots) with a background form having the background to display. (like an image of some sort)

    No API is involved here though.

    and there is any transparent textbox(activex control) 100% free?(if you know)
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    Re: [VB6] - Hide textbox(or other control) backcolor

    You can try to search for it. Here is one for example:
    http://www.codeproject.com/KB/edit/a...ndtextbox.aspx

  5. #5

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: [VB6] - Hide textbox(or other control) backcolor

    Quote Originally Posted by bergerkiller View Post
    You can try to search for it. Here is one for example:
    http://www.codeproject.com/KB/edit/a...ndtextbox.aspx
    these is for .NET not for VB6
    VB6 2D Sprite control

    To live is difficult, but we do it.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [VB6] - Hide textbox(or other control) backcolor

    Quote Originally Posted by joaquim View Post
    can i hide the textbox(or picturebox) backcolor?
    (it's a question that normaly i found the code for a form)
    Though this is not a truly transparent picturebox, but it may be something to play with.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,966

    Re: [VB6] - Hide textbox(or other control) backcolor

    Quote Originally Posted by LaVolpe View Post
    Though this is not a truly transparent picturebox, but it may be something to play with.
    hi LaVolpe. how are you?
    it's very cool... but if i want a textbox backcolor transparent?
    you speak about UC, but i wanted a controls.. sorry
    VB6 2D Sprite control

    To live is difficult, but we do it.

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