|
-
Feb 11th, 2003, 04:02 PM
#1
Thread Starter
Hyperactive Member
Api questions
Does anyone know how to convert this VB6 api to VB.Net?
I always used it in vb6 to give my textboxes an flatter style.
VB Code:
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal CX As Long, ByVal CY As Long, ByVal wFlags As Long) As Long
Const GWL_EXSTYLE = (-20)
Const WS_EX_CLIENTEDGE = &H200
Const WS_EX_STATICEDGE = &H20000
Const SWP_FRAMECHANGED = &H20
Const SWP_NOMOVE = &H2
Const SWP_NOOWNERZORDER = &H200
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
Sub MakeFlat(lHwnd As Long)
Dim lRet As Long
lRet = GetWindowLong(lHwnd, GWL_EXSTYLE)
lRet = WS_EX_STATICEDGE
SetWindowLong lHwnd, GWL_EXSTYLE, lRet
SetWindowPos lHwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED
End Sub
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 11th, 2003, 04:06 PM
#2
textbox1.BorderStyle =BorderStyle.None
-
Feb 11th, 2003, 04:06 PM
#3
Sleep mode
try this now
VB Code:
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA"(ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA"(ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer
Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal CX As Integer, ByVal CY As Integer, ByVal wFlags As Integer) As Integer
Const GWL_EXSTYLE As Short = (-20)
Const WS_EX_CLIENTEDGE As Short = &H200s
Const WS_EX_STATICEDGE As Integer = &H20000
Const SWP_FRAMECHANGED As Short = &H20s
Const SWP_NOMOVE As Short = &H2s
Const SWP_NOOWNERZORDER As Short = &H200s
Const SWP_NOSIZE As Short = &H1s
Const SWP_NOZORDER As Short = &H4s
Sub MakeFlat(ByRef lHwnd As Integer)
Dim lRet As Integer
lRet = GetWindowLong(lHwnd, GWL_EXSTYLE)
lRet = WS_EX_STATICEDGE
SetWindowLong(lHwnd, GWL_EXSTYLE, lRet)
SetWindowPos(lHwnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED)
End Sub
-
Feb 11th, 2003, 04:38 PM
#4
Thread Starter
Hyperactive Member
Originally posted by Cander
textbox1.BorderStyle =BorderStyle.None
Thats not what i ment 
Pirate, in vb6 i used Makeflat Text1.hWnd, but in .net the textbox doesn't have a .hWnd function.
How should i do that?
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 11th, 2003, 10:50 PM
#5
Sleep mode
Did you try the code ?It's the converted version .I guess it will work !
-
Feb 12th, 2003, 04:25 AM
#6
Thread Starter
Hyperactive Member
no, it didn't work
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
-
Feb 12th, 2003, 12:55 PM
#7
Sleep mode
this should work for you !
-
Feb 12th, 2003, 05:24 PM
#8
Originally posted by phrozeman
Thats not what i ment 
Pirate, in vb6 i used Makeflat Text1.hWnd, but in .net the textbox doesn't have a .hWnd function.
How should i do that?
use textbox.Handle instead of hwnd
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Feb 13th, 2003, 01:32 PM
#9
Thread Starter
Hyperactive Member
Thanks MrPolite/Pirate... got it working now
There's a certain mystique when I speak, that you notice that it's sorta unique, cause you know it's me
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
|