vb时钟小程序下载
⑴ 简单的VB小程序
在窗体添加一个标签,一个计时器控件,
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
Label1.Caption = "字体随机变色"
End Sub
Private Sub Timer1_Timer()
Label1.ForeColor = RGB(Rnd * 256, Rnd * 256, Rnd * 256)
End Sub
⑵ vb小程序
用按钮控制的话如下:
Private Sub Command1_Click()
For i = 1 To Len(Text1.Text)
If Not (Mid(Text1.Text, i, 1) = "a" Or Mid(Text1.Text, i, 1) = "o" Or Mid(Text1.Text, i, 1) = "i" Or Mid(Text1.Text, i, 1) = "e" Or Mid(Text1.Text, i, 1) = "u") Then
s = s & Mid(Text1.Text, i, 1)
End If
Next
Text1.Text = s
End Sub
直接限制文本枉输入的如下:
Private Sub Text1_Change()
For i = 1 To Len(Text1.Text)
If Not (Mid(Text1.Text, i, 1) = "a" Or Mid(Text1.Text, i, 1) = "o" Or Mid(Text1.Text, i, 1) = "i" Or Mid(Text1.Text, i, 1) = "e" Or Mid(Text1.Text, i, 1) = "u") Then
s = s & Mid(Text1.Text, i, 1)
End If
Next
Text1.Text = s
End Sub
⑶ 用vb做的时钟程序源代码
你要的程序代码来了,已经验证OK!!!
Private Sub Form_Load()
Timer1.Interval = 1000
Label1.AutoSize = True
Label1.Caption = ""
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Now
End Sub
你在窗体上添加一个timer控件和一个label标签,把上面的代码复制进去看结果吧!以后共同努力!!!
⑷ vb小程序下载
请问是什么程序, 叫我等如何回答?
⑸ VB编写小时钟程序
使用timer控件进行计时
使用全局数组变量进行多人同时计时,用text控件来设置人数
使用数学函数(如sin,cos)和时间函数(如:hour,second)实现动态指针时钟
⑹ vb 小程序 谢谢
PrivateSubCommand1_Click()
DimiAsInteger,nAsInteger
Dima()AsInteger
n=100
ReDima(n)AsInteger
Fori=1Ton
a(i)=100*Rnd
Next
CallSortnum(a,n)
Fori=1Ton
IfSeven(a(i))=TrueThenPrinta(i);
Next
EndSub
SubSortnum(a()AsInteger,n)
DimiAsInteger,jAsInteger,tAsInteger
Fori=1Ton
Forj=iTon
Ifa(i)>a(j)Then
t=a(i)
a(i)=a(j)
a(j)=t
EndIf
Next
Next
EndSub
FunctionSeven(nAsInteger)AsBoolean
IfnMod7=0Then
Seven=True
Else
Seven=False
EndIf
EndFunction
⑺ VB小程序
首先插入一个Command,之后写入代码:
Private Sub Form_Load()
a = 1
End Sub
Private Sub Command1_Click()
If a=1 Then
Print "欢迎内进入"
a=2
Else
print "VB初学者容"
End if
End Sub
⑻ vb小程序下载地方
http://www.codefans.net/
⑼ VB6.0 倒计时的小程序
Dim ydsj As Date
Private Sub Form_Load()
ydsj = InputBox("请输入约定时间!格式如括号里:(年号/月号/日子)或者又如括号里:(年号/月号/日子空格小时:分钟:秒数)如下格式:", , "2011/1/1 00:00:00")
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim dqnyr As Date
If Now < ydsj Then
sysj = ydsj - Now
syn = Year(ydsj) - Year(Now) - 1
If Year(ydsj) = Year(Now) Then syn = syn + 1 '年
syy = 12 - Month(Now) & "+" & Month(ydsj) - 1 & "=" & 12 - Month(Now) + Month(ydsj) - 1
If Year(ydsj) = Year(Now) Then
syy = Month(ydsj) - Month(Now) - 1
If Month(ydsj) = Month(Now) Then syy = syy + 1
End If
'月
dqnf = Year(Now)
dqyf = Month(Now)
If dqyf = 12 Then
dqyf = 1
dqnf = dqnf + 1
End If
dqnyr = dqnf & "-" & dqyf & "- " & 1
syr = Fix(dqnyr - Now) & "+" & Day(ydsj) - 1 & "=" & Fix(dqnyr - Now) + Day(ydsj) - 1
If Year(ydsj) = Year(Now) And Month(ydsj) = Month(Now) Then syr = Fix(dqnyr - Now) - Fix(dqnyr - ydsj) '日
nowh = Format(Now, "hh")
nowm = Format(Now, "nn")
nows = Format(Now, "ss")
now1 = Date + 1
dqsyhms = now1 - Now
nowsyh = Format(dqsyhms, "hh")
nowsym = Format(dqsyhms, "nn")
nowsys = Format(dqsyhms, "ss")
ydhms = Format(ydsj, "hh:mm:ss")
ydh = Format(ydsj, "hh")
ydm = Format(ydsj, "nn")
yds = Format(ydsj, "ss")
syh = nowsyh & "+" & ydh & "=" & Val(nowsyh) + Val(ydh)
bzd = Format(ydsj, "yyyy-m-d")
If Format(Now, "yyyy-mm-dd") = Format(ydsj, "yyyy-mm-dd") Then
syh = ydh - nowh
End If
'时
sym = nowsym & "+" & ydm & "=" & Val(nowsym) + Val(ydm)
If Format(Now, "yyyy-mm-dd hh") = Format(ydsj, "yyyy-mm-dd hh") Then
sym = ydm - nowm
End If
'分
sys = nowsys & "+" & yds & "=" & Val(nowsys) + Val(yds)
If Format(Now, "yyyy-mm-dd hh:nn") = Format(ydsj, "yyyy-mm-dd hh:nn") Then
sys = yds - nows
End If
'秒
Label1.Caption = "当前时间是:" & Now & " 距 " & ydsj & "还有(" & syn & ")个年头+(" & syy & ")个月份+(" & syr & ")个日子+(" & syh & ")小时+(" & sym & ")分钟+(" & sys & ")秒;合计=: (" & sysj & ")天!"
ElseIf Now = ydsj Then
Label1.FontSize = 28
Label1.ForeColor = &HFF&
Label1.Caption = ydsj & "到了!祝您在以后的日子里万事如意,身体安康!88!88!"
Timer1.Interval = 8888
ElseIf Now > ydsj Then
Label1.FontSize = 28
Label1.ForeColor = &HFF0000
Label1.Caption = ydsj & "已经过了!祝您万事如意,身体安康!"
End If
End Sub
⑽ 求一个vb小程序,很简单的时间小程序
不用Timer.改模块代码即可。
1.模块里面找到
Private lngHook As Long这一行,改成
Private lngHook As Long,oldTimer As Long
2.模块里面找到
If p.vkCode = vbKeyF10 Then
MsgBox "你按下了F10"
End If
这三行,换成:
If p.vkCode = vbKeyF10 and Timer - oldTimer > 30 Then
MsgBox "你按下了F10"
oldTimer = Timer
End If
这样你两次快捷键按下间隔小于30秒时候将不弹出对话框