请各位VB高手帮我看一下这个程序好吗?

请各位VB高手帮我看一下这个程序好吗?,第1张

'定义常量

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

欢迎分享,转载请注明来源:表白网

原文地址:https://h5.hunlipic.com/biaobai/3368452.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2024-02-24
下一篇2024-02-24

发表评论

登录后才能评论

评论列表(0条)

    保存