楼主您好!
代码如下:
Option ExplicitPrivate Sub Command1_Click()
Dim n(7) As Double
Dim k(3) As Double
k(3) = 1
Dim j As Integer
For j = 1 To 7
n(j) = Val(Controls("Text" & CStr(j))Text)
Next j
For j = 1 To 7
k(1) = k(1) + n(j)
k(2) = k(2) - n(j)
k(3) = k(3) n(j)
Next j
MeText8Text = "7个数的和为:" & k(1) & vbCrLf & _
"7个数的差为:" & k(2) & vbCrLf & _
"7个数的乘积为:" & k(3)
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = 1 To 8
Controls("Text" & CStr(i))Text = ""
Next i
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 8
Controls("Text" & CStr(i))Text = ""
Next i
End Sub
添加一1个label,一个command,一个text即可,可循环修改密码
Dim a As StringPrivate Sub Command1_Click()
If Command1Caption = "确认" Then
If Text1 = a Then
Call nex
Else
MsgBox "密码错误!", vbExclamation, "信息"
Text1 = ""
Text1SetFocus
End If
ElseIf Command1Caption = "修改" Then
Call xg
End If
End Sub
Sub nex()
Label1Caption = "新密码:"
Text1Text = ""
Text1SetFocus
Command1Caption = "修改"
End Sub
Private Sub Form_Load()
MeCaption = "密码修改"
Text1 = ""
Text1PasswordChar = ""
Text1ToolTipText = "默认密码:admin"
Label1Caption = "原密码:"
Command1Caption = "确认"
Call mi
End Sub
Sub mi()
If Dir(AppPath + "\mm") <> "" Then
Open AppPath + "\mm" For Input As #1
Input #1, a
Close #1
End If
If a = "" Then a = "admin"
End Sub
Sub xg()
Open AppPath + "\mm" For Output As #1
Print #1, Text1Text
Close #1
a = Text1
MsgBox "密码修改成功!", vbInformation, "提示"
Text1 = ""
Text1SetFocus
Command1Caption = "确认"
Label1Caption = "原密码:"
End Sub
Dim sec, min, h
Private Sub Command1_Click()
Timer1Enabled = True
h = Text1Text
min = Text2Text
sec = Text3Text
Timer2Enabled = False
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Form1BackColor = &HFFFF00
Timer1Enabled = False
Timer1Interval = 1000
Timer2Enabled = True
Timer2Interval = 1000
Text1Text = 2
Text2Text = "00"
Text3Text = "00"
Command2Caption = "退出"
Command1Caption = "开始倒计时"
End Sub
Private Sub Timer1_Timer()
If sec > 0 Then
sec = sec - 1
Else:
If (min > 0 Or h > 0) Then
sec = 59
End If
If min > 0 Then
min = min - 1
Else:
If h > 0 Then
min = 59
End If
If h > 0 Then
h = h - 1
Else: Timer1Enabled = False
CreateObject("SAPISpVoice")Speak "GAME OVER!"
Form1BackColor = &HFF
End If
End If
End If
Text1Text = h
Text2Text = min
Text3Text = sec
Label6Caption = Now
End Sub
Private Sub Timer2_Timer()
Label6Caption = Now
End Sub
近日,一个00后程序员写代码让女朋友甚是感到暖心,这个女朋友天天喜欢网购各种各样的产品,有时也会为了买的便宜用一些优惠券之类的,但是因为网购优惠的方式太多,难免会有些疏漏,做一些无用功夫,很懊恼。于是程序员男友就给女友做了一个小软件,专门检测这个产品什么时间点最便宜,小程序就会弹出一个小爱心,表示最便宜事宜买,女朋友就觉得男朋友好浪漫。
不得不说,这样的做法确实能让女朋友开心,这个女朋友说男朋友平时就喜欢敲代码和玩一些游戏,没有其他的爱好了,他看到女孩子有时的烦恼,就想办法给他解决了这个问题,真的很暖心,很懂她。谁说程序员男生都比较古板,木讷,看看这个男孩子还真的是懂得怎样讨女孩子欢心,他的重点在于解决了女孩子的烦恼,并表达的直观,浪漫。
我们印象里面程序员的生活就是两点一线,很中规中矩的,没有什么多余的想法,他们只是对代码感兴趣,而这个女孩子的男朋友却让人对程序员另眼相待了。其实之前就有一个事例,一个程序员男朋友惹了自己的女朋友不开心,于是想发设发的道歉,女朋友就是不理,最后程序员在电脑上做了一个道歉的小程序,最后把女友逗的不得不原谅,电脑才正常,真的是很搞笑。
其实两个相爱的人,有能力爱的人都是会浪漫的,只看那个人是否有心去逗你开心,如果不是特别爱,他可能就没有那么多心思去维护感情,而深爱的人才愿意花心思去解你的忧愁。程序员的生活和工作给人刻板的印象,当然懂得取悦自己的爱人也大有人在。
欢迎分享,转载请注明来源:表白网
评论列表(0条)