当前位置:编程学习 > VB >>

创建不规则窗口

答案:
创建不规则窗口
Win32 API 有很多让你意想不到的功能。要创建特殊的不规则窗口看上去似乎很难。但我们如果我们说我们用几行代码就可以实现,这似乎不可思议。但事实就是如此!请试试:

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 SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

Private Sub Form_Load()

Show 'The form!

SetWindowRgn hWnd, CreateEllipticRgn(0, 0, 300, 200), True

End Sub

上述代码可以创建一个椭圆形状的窗口。怎么样?

上一个:做出分隔线
下一个:操作VB中的无边框窗体

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,