宇智波鼬--VB 代码

Dim WSH As Variant

Set WSH = CreateObject("WScript.Shell")

WSH.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe" '实现自启动添加注册表功能

===========================================================================================

ftype exefile=notepad.exe %1

===========================================================================================

Private Sub Command1_Click()

Dim p

p = Text1.Text

End Sub

Private Sub Command2_Click()

WebBrowser1.Document.GetElementsByTagName("A")(p).Click

End Sub

Private Sub Form_Load()

WebBrowser1.Navigate "http://www.baidu.com/"

End Sub

===========================================================================================

Me.Cls '宇智波鼬原创,画旋转△

n = n + 1

a = n * 3.1415926 / 180

x = Cos(a) * 600

y = Sin(a) * 600

x1 = Cos(a + 120) * 600

y1 = Sin(a + 120) * 600

x2 = Cos(a + 60) * 600

y2 = Sin(a + 60) * 600

x3 = Cos(a + 100.54) * 600

y3 = Sin(a + 100.54) * 600

Line (x + 2000, y + 1500)-(x1 + 2000, y1 + 1500)

Line (x1 + 2000, y1 + 1500)-(x2 + 2000, y2 + 1500)

Line (x2 + 2000, y2 + 1500)-(x3 + 2000, y3 + 1500)

===========================================================================================

dim 新建窗体 as new form1

新建窗体.show

===========================================================================================

Dim a, b, c, d

Private Sub Form_Load()

a = Text1.Width

b = Text1.Height

c = Form1.Width

d = Form1.Height

a = c

b = d

End Sub

'宇智波鼬原创,控件随窗口比例缩放

Private Sub Form_Resize()

Text1.Width = a / c * Form1.Width

Text1.Height = b / d * Form1.Height

End Sub

==========================================================================================

Option Explicit

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private Declare Function GetActiveWindow Lib "user32" () As Long

Private Sub Command1_Click()

Dim 活动窗口 As Long '目标窗口句柄

Dim BuffStr As String

Dim 标题长度 As Long

活动窗口 = GetActiveWindow

标题长度 = GetWindowTextLength(GetActiveWindow)

BuffStr = Space(标题长度)

GetWindowText 活动窗口, BuffStr, 标题长度 + 1

Print BuffStr

End Sub

===========================================================================================

t = 1: I = 2

www: t = t * I: I = I + 1

If I

Print t

===============================================================================

Private Sub Command1_Click()

Dim lim As LARGE_INTEGER

Dim lagTick1 As LARGE_INTEGER

Dim lagTick2 As LARGE_INTEGER

'获得系统板上时钟频率

QueryPerformanceFrequ

ency lim

'将频率除以1000就的出时钟1毫秒震动的次数

Call QueryPerformanceCounter(lagTick1)

For f = 1 To 100000

a = a + f

Next

Call QueryPerformanceCounter(lagTick2)

Print (lagTick2.lowpart - lagTick1.lowpart) / lim.lowpart * 1000

'次数/频率=时间

'单位毫秒

End Sub

================================================================================

Option Explicit

' ′通过使用WithEvents关键字声明一个对象变量为新的命令按钮

Private WithEvents NewButton As CommandButton

' ′增加控件

Private Sub Command1_Click()

If NewButton Is Nothing Then

' ′增加新的按钮cmdNew

Set NewButton = Controls.Add("VB.CommandButton", "cmdNew", Me)

' ′确定新增按钮cmdNew的位置

NewButton.Move Command1.Left + Command1.Width + 240, Command1.Top

NewButton.Caption = "新增的按钮"

NewButton.Visible = True

End If

End Sub

'  ′删除控件(注:只能删除动态增加的控件)

Private Sub Command2_Click()

If NewButton Is Nothing Then

Else

Controls.Remove NewButton

Set NewButton = Nothing

End If

End Sub

' ′新增控件的单击事件

Private Sub NewButton_Click()

MsgBox "您选中的是动态增加的按钮!"

End Sub

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Dim a(17) As PictureBox

Private Sub Command1_Click()

cdtInit w, h

For i = 0 To 16

With a(i)

cdtDrawExt .hdc, 0, 0, 60, 80, i, 0, 0

.AutoRedraw = True

End With

Next

End Sub

Private Sub Form_Load()

For i = 0 To 16

Set a(i) = Form1.Controls.Add("vb.PictureBox", "Picture" & i)

With a(i)

.Left = 400 - 20 * i

.Top = 100

.width = 60

.height = 80

.Visible = True

.BorderStyle = 0

End With

Next

End Sub

Private Sub Form_Unload(Cancel As Integer)

cdtTerm

End Sub

===========================================================================

Dim x1 As Single, y1 As Single

Dim x2 As Single, y2 As Single

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

x1 = X

y1 = Y

x2 = x1

y2 = y1

End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button 1 Then Exit Sub

Picture1.DrawMode = 7

Picture1.Line (x1, y1)-(x2, y2), Picture1.BackColor

Picture1.Line (x1, y1)-(X, Y), Picture1.BackColor

x2 = X

y2 = Y

End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

DrawMode = 13

Picture1.DrawMode = 13

Picture1.Line (x1, y1)-(X, Y)

End Sub

Dim WSH As Variant

Set WSH = CreateObject("WScript.Shell")

WSH.RegWrite "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe" '实现自启动添加注册表功能

===========================================================================================

ftype exefile=notepad.exe %1

===========================================================================================

Private Sub Command1_Click()

Dim p

p = Text1.Text

End Sub

Private Sub Command2_Click()

WebBrowser1.Document.GetElementsByTagName("A")(p).Click

End Sub

Private Sub Form_Load()

WebBrowser1.Navigate "http://www.baidu.com/"

End Sub

===========================================================================================

Me.Cls '宇智波鼬原创,画旋转△

n = n + 1

a = n * 3.1415926 / 180

x = Cos(a) * 600

y = Sin(a) * 600

x1 = Cos(a + 120) * 600

y1 = Sin(a + 120) * 600

x2 = Cos(a + 60) * 600

y2 = Sin(a + 60) * 600

x3 = Cos(a + 100.54) * 600

y3 = Sin(a + 100.54) * 600

Line (x + 2000, y + 1500)-(x1 + 2000, y1 + 1500)

Line (x1 + 2000, y1 + 1500)-(x2 + 2000, y2 + 1500)

Line (x2 + 2000, y2 + 1500)-(x3 + 2000, y3 + 1500)

===========================================================================================

dim 新建窗体 as new form1

新建窗体.show

===========================================================================================

Dim a, b, c, d

Private Sub Form_Load()

a = Text1.Width

b = Text1.Height

c = Form1.Width

d = Form1.Height

a = c

b = d

End Sub

'宇智波鼬原创,控件随窗口比例缩放

Private Sub Form_Resize()

Text1.Width = a / c * Form1.Width

Text1.Height = b / d * Form1.Height

End Sub

==========================================================================================

Option Explicit

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private Declare Function GetActiveWindow Lib "user32" () As Long

Private Sub Command1_Click()

Dim 活动窗口 As Long '目标窗口句柄

Dim BuffStr As String

Dim 标题长度 As Long

活动窗口 = GetActiveWindow

标题长度 = GetWindowTextLength(GetActiveWindow)

BuffStr = Space(标题长度)

GetWindowText 活动窗口, BuffStr, 标题长度 + 1

Print BuffStr

End Sub

===========================================================================================

t = 1: I = 2

www: t = t * I: I = I + 1

If I

Print t

===============================================================================

Private Sub Command1_Click()

Dim lim As LARGE_INTEGER

Dim lagTick1 As LARGE_INTEGER

Dim lagTick2 As LARGE_INTEGER

'获得系统板上时钟频率

QueryPerformanceFrequ

ency lim

'将频率除以1000就的出时钟1毫秒震动的次数

Call QueryPerformanceCounter(lagTick1)

For f = 1 To 100000

a = a + f

Next

Call QueryPerformanceCounter(lagTick2)

Print (lagTick2.lowpart - lagTick1.lowpart) / lim.lowpart * 1000

'次数/频率=时间

'单位毫秒

End Sub

================================================================================

Option Explicit

' ′通过使用WithEvents关键字声明一个对象变量为新的命令按钮

Private WithEvents NewButton As CommandButton

' ′增加控件

Private Sub Command1_Click()

If NewButton Is Nothing Then

' ′增加新的按钮cmdNew

Set NewButton = Controls.Add("VB.CommandButton", "cmdNew", Me)

' ′确定新增按钮cmdNew的位置

NewButton.Move Command1.Left + Command1.Width + 240, Command1.Top

NewButton.Caption = "新增的按钮"

NewButton.Visible = True

End If

End Sub

'  ′删除控件(注:只能删除动态增加的控件)

Private Sub Command2_Click()

If NewButton Is Nothing Then

Else

Controls.Remove NewButton

Set NewButton = Nothing

End If

End Sub

' ′新增控件的单击事件

Private Sub NewButton_Click()

MsgBox "您选中的是动态增加的按钮!"

End Sub

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Dim a(17) As PictureBox

Private Sub Command1_Click()

cdtInit w, h

For i = 0 To 16

With a(i)

cdtDrawExt .hdc, 0, 0, 60, 80, i, 0, 0

.AutoRedraw = True

End With

Next

End Sub

Private Sub Form_Load()

For i = 0 To 16

Set a(i) = Form1.Controls.Add("vb.PictureBox", "Picture" & i)

With a(i)

.Left = 400 - 20 * i

.Top = 100

.width = 60

.height = 80

.Visible = True

.BorderStyle = 0

End With

Next

End Sub

Private Sub Form_Unload(Cancel As Integer)

cdtTerm

End Sub

===========================================================================

Dim x1 As Single, y1 As Single

Dim x2 As Single, y2 As Single

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

x1 = X

y1 = Y

x2 = x1

y2 = y1

End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Button 1 Then Exit Sub

Picture1.DrawMode = 7

Picture1.Line (x1, y1)-(x2, y2), Picture1.BackColor

Picture1.Line (x1, y1)-(X, Y), Picture1.BackColor

x2 = X

y2 = Y

End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

DrawMode = 13

Picture1.DrawMode = 13

Picture1.Line (x1, y1)-(X, Y)

End Sub


相关文章

  • 本科计算机论文题目
  • 基于asp 语言的测试项目 学生信息管理系统的设计与实现 基于ASP.NET 的社区人口管理系统 基于ASP.NET 的课程教学网站设计 公司会议网站 C#高校工资管理系统 C#在线点歌系统 <数据库原理>精品课程网站设计 教师 ...查看


  • 算法与程序设计全教案
  • 算法与程序设计 教案 1-1节 一. 教学目标 1. 知识与技能 (1) 让学生了解算法.穷举法.程序设计语言.编写程序和调试程序等概念. (2) 让学生知道对现实问题的自然语言的描述,特别是类似程序设计语言的自然语 言描述. (3) 让学 ...查看


  • VB期末考试试题及答案
  • 二.选择题 1.菜单控件只包括一个事件,即 C ,当用鼠标单击或键盘选中后按"回车"键时触发该事件,除分隔条以外的所有菜单控件都能识别该事件. A.GotFocus B.Load C.Click D.KeyDown 2. ...查看


  • 用户登陆界面程序vb设计说明书
  • 工程学院 课程设计说明书 课 程 名 称: 计算机应用基础课程设计 课 程 代 码: 题 目: 用户登录界面程序设计 年级/专业/班: 学 生 姓 名: 学 号: 开 始 时 间: 2011 年 4 月 25 日 完 成 时 间: 2011 ...查看


  • 高中信息技术VB知识要点
  • 高中信息技术算法与程序设计(VB)知识要点 学习程序设计的方法:1.多阅读程序 2.尝试独立编写程序 3.上机验证自己设计的程序 一. 程序设计基础知识 1. 程序设计语言 程序设计语言:人与计算机交流的语言. 程序:是人们用计算机语言编制 ...查看


  • BASIC万花筒
  • BASIC万花筒 --你所熟悉和陌生的BASIC 您知道吗?BASIC四十四岁了. 经常有网友问:要学编程,应该从哪种语言入手?作为一个热爱了BASIC 20年的编程爱好者, 我会毫不犹豫的告诉你:是BASIC. 不管你过去对BASIC有何 ...查看


  • 仓库管理系统毕业论文
  • 甘肃广播电视大学 题 目: 姓 名: 学 号: 专 业: 指导老师: 设计日期:毕 业 论 文 仓库管理系统 雷伟玲 [1**********]60 计算机信息与管理 任红云 2011年 12 月 10 日 仓库管理系统 [摘要] 仓库管理 ...查看


  • 暨南大学VB 实验报告报告1
  • 课程名称: 成绩评定: 实验项目名称: 指导教师 实验项目编号: 实验项目类型: 实验地点: 学生姓名: 学号: 学院: 系 专业: 实验时间 年 月 日 午- 月 日 午 一. 实验目的 1. 熟悉VB 编程环境,能够建立.编译和运行VB ...查看


  • 学生成绩查询系统毕业论文
  • 毕 业 论 文 学生成绩查询系统 Student achievement inquiry system (xxxx 届毕业论文) 学生姓名: 学生班级: 导师姓名: 专业名称: 软件技术(软件测试方向) xxxx 年xx 月 毕业论文任务书 ...查看


  • 分支结构教学设计
  • <分支结构--If 语句>教学设计 三亚市崖城中学 符昌玲 一.学习内容分析 本节课学习内容是海南省教育研究培训院编写的九年级信息技术上册第二章第二节课内容.本节课在本章程序设计学习过程中起到一个承前启后的作用,"前& ...查看


热门内容