17. oktober 2005 - 17:18
Der er
2 løsninger
ændre program form til noget exklusivt
et standard compileret VB program er et firkantet vindue.. kedeligt.. ..
jeg har set så mange forskellige programmer der er runde, og har fede former... hvordan giver man sit VB program et udseende som man har tegnet i f.eks Fireworks.. ???
19. oktober 2005 - 14:19
#2
Private Declare Function SetWindowRgn Lib "USER32" ( _
ByVal hwnd As Long, _
ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function CreatePolygonRgn Lib "gdi32" ( _
lpPoint As POINTAPI, _
ByVal nCount As Long, _
ByVal nPolyFillMode As Long) As Long
Private Declare Function CreateRoundRectRgn Lib "gdi32" ( _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long, _
ByVal CornerWidth As Long, _
ByVal CornerHeight As Long) As Long
Private Declare Function CreateEllipticRgn Lib "gdi32" ( _
ByVal X1 As Long, _
ByVal Y1 As Long, _
ByVal X2 As Long, _
ByVal Y2 As Long) As Long
Private Sub Form_Load()
Call CreateRoundRectFromWindow(Me)
End Sub
Private Sub CreateRoundRectFromWindow(ByRef oWindow As Object)
Dim hRgn As Long
hRgn = CreateRoundRectRgn(0, 0, oWindow.Width / Screen.TwipsPerPixelX, oWindow.Height / Screen.TwipsPerPixelY, 40, 40)
Call SetWindowRgn(.hwnd, hRgn, True)
End Sub