共 22 篇文章 |
|
只好将采集的图片区域向下多延伸2个像素Public Sub ColorToBlackAndWhite(ByRef SrcData() As Byte, ByRefDestData() As Byte) Dim i As Long, j As Long, k AsLong Dim red As Byte, green AsByte, blue As Byte Dim Color As Long, newcolor AsLong Dim Width As Long, Height AsLong. 阅1 转自hdzgx 公众公开 24-04-06 10:57 |
阅1 转自hdzgx 公众公开 23-01-20 13:11 |
Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, _ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _ByVal wMs... 阅120 转0 评0 公众公开 23-01-20 02:28 |
SendMessage函数的常用消息及其应用大全。Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, _ ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessa... 阅1 转自悟静 公众公开 23-01-20 02:15 |
事件的响应方,或者称之为事件监听者(Event Sink),可以为窗体或者其他的对象。1) 在这个过程中我们定义了一个myCmd对象,用于响应CommandButton1_Click,即CommandButton1的单击事件。2) 在窗体的加载时Set myCmd = UserForm1.CommandButton1 令myCmd对象指向CommandButton1.3) 当CommandButton1的单击事件发生时:窗体的监听到后弹出对... 阅1 转自东西二王 公众公开 23-01-19 22:19 |
Private Sub Chart事件_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long) Debug.Print x, yEnd Sub.Dim 新Chart类 As New Chart类Private Sub Worksheet_Activate() Set 新Chart类.Chart事件 = ActiveSheet.ChartObjects(1).ChartEnd Sub.Sub 结束事件连接() Set 新Chart类.Chart事件 = Nothing... 阅13 转0 评0 公众公开 23-01-16 23:36 |
类模块实例。Private ShtName, rng, cTypeProperty Let 目标工作表(mysheetname As String)ShtName = mysheetnameEnd PropertyProperty Let 数据区域(myRng As Range)Set rng = myRngEnd PropertyProperty Let 图表类型(myType As Integer)Select Case myTypeCase 0.Sub test()Dim myChart As New NewChartmyChart.目标工作表 = "Sheet1&q... 阅1 转自gblhp 公众公开 23-01-16 01:08 |
学习类模块写法 1.Private 性别_值 As String, 年龄_值 As Integer, 年龄是否受保护 As Boolean.Property Let 性别(x As String)Property Get 性别() As String.性别 = 性别_值。Property Let 年龄(x As Integer)Property Get 年龄() As Integer.年龄 = 年龄_值。Property Get 受到未成年保护()MsgBox 性别_值 &" "&年龄_值... 阅2 转0 评0 公众公开 23-01-16 00:44 |
Dim objDic As Object.Dim strRef As String, objIE As Object.Sub FindFrame(ByVal objframe As Object, ByVal CellName As String)Sub OutPutAllCell(ByVal objframe As Object, ByVal CellName As String)Dim subitem As Object.objDic(subitem.tagName) = objDic(subitem.tagName) + 1.strCode = "(" &subitem.tagName &... 阅11 转0 评0 公众公开 23-01-10 17:00 |
VB代码简易浏览器:捕获 WebBrowse 控件的鼠标和键盘事件(包含内嵌网页和框架)利用 WebBrowse 控件的 event 对象,可以捕获 WebBrowser 众多的鼠标和键盘事件,如鼠标坐标、按下了键盘哪个键,以及键盘 Ctrl、Alt、Shift 键的状态、当前网页元素的ID、索引等等。Tag, "GotFocus" ''获得焦点''End Sub''Pri... 阅1 转自局部地区... 公众公开 23-01-01 10:29 |