|
-
Sep 8th, 2000, 03:19 PM
#1
Thread Starter
Frenzied Member
hello
how do I get my text box's back style to be transparent?
NXSupport - Your one-stop source for computer help
-
Sep 8th, 2000, 08:34 PM
#2
Fanatic Member
it didn't work for me, but you could try this:
Code:
Private Sub Form_Initialize()
Dim styles As Long
styles = GetWindowLong(Text1.hwnd, GWL_EXSTYLE)
Dim newstyle
newstyle = SetWindowLong(Text1.hwnd, GWL_EXSTYLE, sytles Or WS_EX_TRANSPARENT)
End Sub
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Sep 8th, 2000, 08:35 PM
#3
Thread Starter
Frenzied Member
nope, doesn't work for me either
NXSupport - Your one-stop source for computer help
-
Sep 8th, 2000, 08:54 PM
#4
Try this:
Code:
Option Explicit
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
Public Function MakeTextboxTransparent(TextCtl As Object) As Boolean
On Error Resume Next
TextCtl.BackColor = TextCtl.Parent.BackColor
SetWindowLong TextCtl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
MakeTextboxTransparent = Err.LastDllError = 0
End Function
Usage:
MakeTextboxTransparent Text1
-
Sep 8th, 2000, 08:59 PM
#5
Thread Starter
Frenzied Member
I did that and it works but it conflictss with the rest of my code
NXSupport - Your one-stop source for computer help
-
Sep 8th, 2000, 09:12 PM
#6
Post your code where it conflicts (where you make the Textbox transparent).
-
Sep 8th, 2000, 09:14 PM
#7
Thread Starter
Frenzied Member
its for the Bat Encoder and an error hit 1 line then I put a ' infront of it and the next line came up to be a problem then the next and the next and the next and the next
NXSupport - Your one-stop source for computer help
-
Sep 8th, 2000, 09:26 PM
#8
Take away the Option Explicit.
Another thing: Are you using VB6? Because I try the code in VB6 and it works perfect for me.
-
Sep 8th, 2000, 09:31 PM
#9
Thread Starter
Frenzied Member
thanks, I took away the option explicit and it worked... now if I click enter in that text box, the next line gets to be the back ground color.
NXSupport - Your one-stop source for computer help
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
|