|
-
Apr 19th, 2001, 12:57 AM
#1
Thread Starter
Member
I am wanting to display a logo on a form (no problem). I also want that logo to be visible the entire time the form is visible. The problem occurs when I have a text box over the logo.
How can I remove the background of the text box and retain the text and the scroll bars?
-
Apr 19th, 2001, 01:11 AM
#2
Fanatic Member
'Code from Matthew Gates
Code:
Private Const WS_EX_TRANSPARENT = &H20&
Private Const GWL_EXSTYLE = (-20)
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Function MakeTextboxTransparent(TxtCtl As Object) As Boolean
On Error Resume Next
TxtCtl.BackColor = TxtCtl.Parent.BackColor
SetWindowLong TxtCtl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
MakeTextboxTransparent = Err.LastDllError = 0
End Function
Private Sub Form_Paint()
Text1.Appearance = 0
Text1.BorderStyle = 0
MakeTextboxTransparent Text1
End Sub
-
Apr 19th, 2001, 01:21 AM
#3
Thread Starter
Member
I've seen this code before. I just tried it again and it does not work. The textbox back color changes to the frm's back color and thats an easy one.
-
Apr 19th, 2001, 01:22 AM
#4
JamesM,
That code makes the textbox transparent, but the back colour of the text box becomes the back colour of the from, not the picture on the form
- gaffa
-
Apr 19th, 2001, 01:26 AM
#5
Thread Starter
Member
Not really. The line 'TxtCtl.BackColor = TxtCtl.Parent.BackColor' does the coloring. If you rem this line out and leave the textbox back color white; when the project is ran the textbox back color is still white not the color of the form.
-
Apr 19th, 2001, 01:27 AM
#6
Fanatic Member
I see, doesn't create true transparency. That is a problem then isn't it...
You can't change the background colout of the textbox to match the picture?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|