圆形的VB形式

时间:2013-08-18 12:08:25

标签: vb6

我正在使用VB6。谁能告诉我如何制作圆形圆形?

我使用过此代码,但显示错误:

Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 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 Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
Private Function fMakeATranspArea(AreaType As String, pCordinate() As Long) As Boolean

1 个答案:

答案 0 :(得分:2)

fMakeATranspArea也可能看起来像是API调用(事实并非如此) - 但它缺少了正文,这可能是您感到困惑的问题。

您可以使用以下手册替换最后一行:

Private Sub Form_Load()
    SetWindowRgn Me.hWnd, CreateEllipticRgn(0, 0, 300, 300), 1
End Sub

你看到的那些数字是坐标。我不建议您修复fMakeATranspArea,因为它似乎很复杂,并且过于复杂化了您可能需要的内容。

CombineRgnCreateRectRgn在这种情况下也是不需要的。

从它的外观来看,你从这里找到了源代码 - 它有完整的实现:

http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=1617&lngWId=-10