求vb求爱程序代码

2025-01-01 15:33:54
推荐回答(1个)
回答1:

教你一个最简单的方法,就是控件的随机移动。
在窗体Form1上显示求爱的话等内容,放置两个按钮,Command1是Yes,Command2是No。
在代码区为Command2编写Command2_MouseMove事件:
Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Command2.Move (Form1.ScaleWidth() - Command2.Width()) * Rnd(), (Form1.ScaleHeight() - Command2.Height()) * Rnd()
End Sub