| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 707 人关注过本帖
标题:高手能帮忙看下哪里出错来,谢谢!
只看楼主 加入收藏
dl5200605
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2009-10-10
结帖率:100%
收藏
 问题点数:0 回复次数:4 
高手能帮忙看下哪里出错来,谢谢!
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode 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 Type POINTAPI
        x As Long
        y As Long
End Type

Private Sub Command1_Click()
Dim ap(4) As POINTAPI
Dim hx As Integer
Dim hy As Integer
Dim rergn As Integer
If Command1.Caption = "恢复" Then
Command1.Caption = "菱形"
SetWindowRgn Me.hWnd, 0, True
Else
Command1.Caption = "恢复"
hy = Me.Height \ (2 * Screen.TwipsPerPixelY)
hx = Me.Width \ (2 * Screen.TwipsPerPixelX)
ap(0).x = 0: ap(0).y = hy
ap(1).x = hx: ap(1).y = 0
ap(2).x = Me.Width \ Screen.TwipsPerPixelX: ap(2).y = hy
ap(3).x = hx: ap(3).y = Me.Height \ Screen.TwipsPerPixelY
ap(4) = ap(0)
rergn = CreatePolygonRgn(ap(0), 5, 1)
SetWindowRgn Me.hWnd, rergn, True
End If
End Sub
2010-05-30 22:13
dl5200605
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2009-10-10
收藏
得分:0 
谢谢呀。太感谢了
2010-05-31 20:53
xiaomarn
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:5
帖 子:348
专家分:2026
注 册:2009-3-18
收藏
得分:0 
rergn = CreatePolygonRgn(ap(0), 5, 1)
C语言中的int对应vb中的long
把Dim rergn As Integer改成Dim rergn As long
2010-06-02 22:30
向钱看
Rank: 2
等 级:论坛游民
帖 子:46
专家分:65
注 册:2010-3-18
收藏
得分:0 
过来学习下
2010-06-05 19:13
快速回复:高手能帮忙看下哪里出错来,谢谢!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020273 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved