how do i get rouned windows with no border in vb6 ?
[help] With Rounded Windows
See the code below. (Quote, then Save it as Form1.frm)
It has a picturebox whose backcolor is set to cyan and the entire windows
transparent color is set to cyan, so that a hole occurs on windows 2000 and xp.
Using that technique, you need to turn your window into borderless, draw the
bevels, minimize box etc on your own and handle them accordingly...
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows-Standard
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 735
Left = 240
ScaleHeight = 675
ScaleWidth = 4275
TabIndex = 0
Top = 120
Width = 4335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, ByVal crey As Long, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const WS_EX_TRANSPARENT = &H20&
Private Const LWA_ALPHA = &H2&
Private Const LWA_COLORKEY = &H1&
Option Explicit
Private Sub Form_Load()
Dim lOldStyle As Long
Picture1.BackColor = RGB(255, 0, 255)
lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, RGB(255, 0, 255), 0, LWA_COLORKEY
End Sub
thanks i'll give it a try later @ home
Aqua-Soft Forums