'定义常量
const yourname = "yumiko886"
const title = "爱情测试"
const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。"
const info = "你在说谎!不要逃避,实话实说。"
const scend = "你说出了你的心扉,那就向他(她)表白吧!"
'定义变量
dim youranswer
'判断输入是否等于yumiko886不是则循环
do
youranswer = inputbox(question, title)
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title
loop until youranswer = yourname
msgbox scend, vbinformation+vbokonly, title
Private Sub Command1_Click()
MeCls
Dim s As Single, j As Long, t As String, n As Long, m As Long
For j = 1000 To 9999
t = j
m = 0
For k = 1 To 4
n = Val(Mid(t, k, 1))
m = m + n n n n
Next
If m = j Then
Print j; "为玫瑰花数"
s = s + j
End If
Next
Print "总和为:"; s
End Sub
首先你要准备一个玫瑰花文件,要小一点。
然后在窗体上放12个Image控件,组成一个控件数组,摆成心形,Picture属性设置为你的玫瑰花。Visibel属性全部设置为False。
在窗体上放一个Timer控件。Interval属性设置为1000,每秒显示一朵玫瑰花。
OK!你的心愿完成了!
Private Sub Form_Load()
For i = 0 To 11
Image1(i)Picture = LoadPicture(AppPath + "\西安绿博园七彩玫瑰jpg")
Next
Timer1Enabled = True
End Sub
Private Sub Timer1_Timer()
Static i As Integer
Image1(i)Visible = True
i = i + 1
If i = Image1Count Then
Label1Visible = True
Timer1Enabled = False
End If
End Sub
欢迎分享,转载请注明来源:表白网
评论列表(0条)