自动抓取屏幕的颜色和坐标…… Private Sub Timer1_Timer() Dim hdc As Long Dim a As POINTAPI Dim quyanse As Long Call GetCursorPos(a) '取得鼠标位置 Text1.Text = a.x Text3.Text = a.y hdc = GetDC(0) '取得整个屏幕的hDC Form1.BackColor = GetPixel(hdc, a.x, a.y) '取 颜色 ReleaseDC 0, hd
omron plc 以太网 Fins 通信测试 源码 Private Sub Command1_Click() Dim CommandStr As String CommandStr = Text2.Text FinsMsg1.sendFinsCommand NetNo.Text, NodeNo.Text, UnitNo.Text, CommandStr 'FinsMsg.sendFinsCommand 网络号, 节点号, 单元号, Fins命令 End Sub Private Sub Com
可以设置定时关机,一段时间后关机 Private Sub Command1_Click() h = Combo1.Text s = Combo2.Text If (h >= 0 And h = 0 And s <= 59) Then Text1.Text = Combo1.Text + ":" + Combo2.Text Form2.Hide Else: MsgBox "你输入的数据格式不正确,是否继续?", vbOKOnly, "错误提示" End If Shell "cmd /
VB计算器程序源码 Dim a(100) As Double Dim n& Dim Plus As Boolean Dim yunsuan(100) As Integer Dim a100 As Double Dim num As Single Private Sub Command1_Click() If Plus = True Then Plus = False Text1.Text = "1" Else Text1.Text = Text1.Text & "1" End If End S
VB编写完整源码判断字符串中某一字符是否大写,执行下面的代码,这个例子简单哦,不多介绍了,直接看代码吧: If Asc(Mid(Text1, Val(Text2), 1)) >= 65 And Asc(Mid(Text1, Val(Text2), 1)) = 97 And Asc(Mid(Text1, Val(Text2), 1)) <= 122 Then Label2.Caption = "位为小写&quo t; End If End If 需要更多代码请
http://blog.sina.com.cn/s/blog_4cd4ffc401018xbx.html vb编写双色球号码生成小程序源码 需要3个label,用来显示相应信息;两个文本框,一个显示生成的号码,一个用来设置号码数量;两个按钮,一个用来开始生成,一个用来复制生成的号码。完整代码如下: 首先声明一个生成号码的函数用于调用 Sub 生成() vb的函数名称可以用汉字的,呵呵 Dim n(1 To 33), i, j, q, p 定义变量 For i = 1 To 33 n(i)