Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003

    Unanswered: How to make textbox Transparent ?

    Vb6 textboxes are opaque and cannot be made transparent.
    Is there a way to make it Transparent ?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2004
    Derbyshire, UK
    Provided Answers: 2

    Not used VB6 for a (long) while and only have it on home PC, but would changing the the textbox colour(s) to tha same as the background work ?


  3. #3
    Join Date
    Jan 2007
    Provided Answers: 12
    BackStyle = 0?
    Or as Mike suggested - just colour it the same as your form
    Home | Blog

  4. #4
    Join Date
    Jun 2004
    Arizona, USA
    Quote Originally Posted by georgev
    BackStyle = 0?
    Unfortunately, the textbox doesn't have a BackStyle property. Either set the backcolor property, or use a label.

    If you need to edit the control (and it must have a transparent background,) try this workaround.

    Use a label with a transparent background. AND have a single, hidden textboxon your form. (probably, make it borderless, with the backcolor the same as your form.) When the label is clicked, position the hidden textbox over the label, make its height and width equal to that of the label, copy the caption from the label to the textbox, then make the textbox visible, and setfocus to the textbox.

    After the user has edited the textbox data, and tabbed on, in the textbox validation event, copy the text from the textbox.text to the label.caption, clear the textbox, and make it not visible again.

    You can use a single textbos, and position/size it as needed for multiple label "entries," or, if you don't mind the overhead of having extra textboxes, you could just add a textbox for each label you need to 'edit' and have it hidden. This works best if you're using control arrays (of labels AND textboxes)
    Last edited by loquin; 05-04-07 at 17:47.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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