关于窗体透明,只显示控件 。。。 。。。

chenxyon 2002-05-30 08:36:58
请问以下的代码总是出在何处,为什么可见的位置不在控件上
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const WINDING = 2

Private Sub Form_Load()
Dim point(0 To 3) As POINTAPI
Dim a As Long, b As Long
Me.ScaleMode = 3
point(0).x = Command1.Left + 3
point(1).x = Command1.Left + Command1.Width + 3
point(2).x = Command1.Left + Command1.Width + 3
point(3).x = Command1.Left + 3
point(0).y = Command1.Top + Command1.Height
point(1).y = Command1.Top + Command1.Height
point(2).y = Command1.Top + 2 * Command1.Height
point(3).y = Command1.Top + 2 * Command1.Height
a = CreatePolygonRgn(point(0), 4, 2)
b = SetWindowRgn(Me.hWnd, a, True)
End Sub
...全文
40 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
CForce 2002-05-31
  • 打赏
  • 举报
回复
兄弟,你跑错位置了吧?这里是C#,不是vb啊?

你窗体的尺寸包括了窗体的“标题栏”的!!所以.....
最简单的解决办法就是把窗体的BorderStyle设为0-none
cnming 2002-05-31
  • 打赏
  • 举报
回复
这是不是VB 6.0 做不规则窗体的代码?

有什么问题?
jhnhu 2002-05-31
  • 打赏
  • 举报
回复
在msdn library online中文 上有文章讲怎么做的!
刚才搜索了一下 没找到 :(
chenxyon 2002-05-31
  • 打赏
  • 举报
回复
up

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧