应用API函数在用户窗体中画圆
来源:互联网 发布:埃及艳后哪个版本 知乎 编辑:程序博客网 时间:2024/05/16 08:33
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long '
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function Ellipse Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Sub MyCircle(MyObject As Object, pX As Long, pY As Long, pR As Long, lcColor As Long, lcFill As Long)
'MyObject 指定圆所在的对象
'
'pX 圆心在对象体上X轴
'
'pY 圆心在对象体上Y轴
'
'pR 圆的半径
'
'lcColor 圆的轮廓颜色
'
'lcFill 圆的填充色
Dim hdc As Long, hpen As Long, hcolor As Long
hdc = GetDC(FindWindow(vbNullString, MyObject.Caption))
hpen = CreatePen(0, 1, lcColor)
hcolor = CreateSolidBrush(lcFill)
SelectObject hdc, hpen
SelectObject hdc, hcolor
Ellipse hdc, pX - pR, pY - pR, pX + pR, pY + pR
DeleteObject hpen
DeleteObject hcolor
End Sub
'
Private Sub UserForm_Click()
MyCircle UserForm1, 100, 100, 50, vbRed, vbBlue
End Sub
- 应用API函数在用户窗体中画圆
- 用API函数在DELPHI中实现“非典型”窗体
- 用API函数在DELPHI中实现“非典型”窗体
- 用API函数在DELPHI中实现“非典型”窗体
- 在C#中使用API函数FINDWINDOW查找窗体
- SendMessage API函数在PowerBuilder中应用
- 浅谈API函数在VB中的应用
- SendMessage API函数在PowerBuilder中应用
- 【机房收费系统】——子窗体在MDI窗体中最小化(API函数:SetParent())
- 用API函数在DELPHI中实现“非典型”窗体
- 使用API函数查找窗体并激活
- 利用API函数实现动画窗体
- c# 使用api函数 ShowWindowAsync 控制窗体
- 如何在 ACCESS 中插入用户窗体?
- SetWindowRgn函数应用--截图,绘制多边形窗体
- 在Form窗体中,this的应用
- API接口函数的应用
- lvm 系统函数API应用
- A* 算法之误区
- 带参数的构造函数.cpp
- IT专业学生求职简历宝典(Leo谈谈写简历)
- 从《读库》关于“报人”文章感叹今日技术媒体
- In the web.xml of your war, have the following entry:
- 应用API函数在用户窗体中画圆
- 指针
- WebBrowser 类
- 浅谈软件度量
- 男人的正确洁面方式
- OpenGL教程之ZEUS教程第一课:什么是OpenGL
- 如何循序渐进向DotNet架构师发展
- SQL*PLUS命令的使用
- Microsoft Windows DHCP Client Service Remote Buffer Overflow