Qeform.bas
' QeForm - Extension of QForm with elliptic edges
' creates an elliptic shpe inside the X1,Y1,X2,Y2 rectangle
$APPTYPE GUI
$INCLUDE "RAPIDQ.INC"
Declare Function SetWindowRgn Lib "user32" Alias "SetWindowRgn" (hwnd As Long, hRgn As Long, bRedraw As Long) As Long
Declare Function DeleteObject Lib "gdi32" Alias "DeleteObject" (hObject As Long) As Long
Declare Function CreateEllipticRgn Lib "gdi32" Alias "CreateEllipticRgn" (X1 As Long, Y1 As Long, X2 As Long, Y2 As Long) As Long
TYPE QeForm EXTENDS QForm
QeRegion AS Long
EVENT OnShow
WITH QeForm
QeRegion=CreateEllipticRgn(0,0,.Width,.Height)
SetWindowRgn .handle,QeRegion,True
END WITH
END EVENT
EVENT OnClose
DeleteObject QeRegion
END EVENT
END TYPE
' Test QeForm component
CREATE Form AS QeForm
BorderStyle=bsDialog
Caption=" QForm with rounded edges"
ShowModal
END CREATE
|