1 Attachment(s)
Controls like textbox with background image?
Hello, I spent several hours searching the forum for some way to make a textbox transparent so that you could see what is behind it, for example a picturebox with an image.
And at most I found some projects that I can transparently see the background outside of the process, but not inside it.
Even if it is being able to draw in the background of a textbox, it would be really useful to simulate transparency.
For example:
Attachment 191984
I know that this topic is very old, and there are examples with broken links or they simply did not work as expected :cry:.
Thank you so much!
Re: Controls like textbox with background image?
2 Attachment(s)
Re: Controls like textbox with background image?
I like that Ben!!
I did something SIMILAR (but not the same) with only a few lines of code...it is not exactly what OP asked for, but they might like it. It looks like this after someone types into the textbox:
Attachment 191986
But while typing in the text box, it changes like this until you hit enter:
Attachment 191987
If that's okay, here is the code:
Code:
Option Explicit
Private Sub Label1_Click()
Text1.Left = Label1.Left
Text1.Top = Label1.Top
Text1.ZOrder (0)
Text1.Visible = True
Text1.SetFocus
Label1.Visible = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Label1.Caption = Text1.Text
Text1.Visible = False
Label1.Visible = True
End If
End Sub
The textbox and label (labelbackGround property set to transparent) are the same size.
Re: Controls like textbox with background image?
Thank you very much guys, both are very good solutions, I will reconsider the use of the dynamics between the label and the textbox.
Ben's solution is the closest to what I was looking for, although when testing the test project, using the debugger generates some unfortunate process crashes.