编写VB事件过程实现以下效果:
- 提问者网友:难遇难求
- 2021-04-29 02:19
(2) 单击按钮Command1使窗体Form1隐藏,显示窗体Form2,按钮Command1失效。
(3) 窗体Form1加载时背景图片为win.jpg,双击窗体后背景图片效果变为某种背景色(颜色随机显示)
- 五星知识达人网友:青尢
- 2021-04-29 03:11
(1)
Private Sub Form_Unload(Cancel As Integer)
MsgBox "拜拜"
Form2.Show
End Sub
(2)
Private Sub Command1_Click()
Me.Hide
Form2.Show
Command1.Enabled = False
End Sub
(3)
Private Sub Form_DblClick()
Randomize
Form1.BackColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Form1.Picture = loadpicture("")
End Sub
Private Sub Form_Load()
Form1.Picture = LoadPicture("f:\win.jpg")
End Sub
- 1楼网友:轮獄道
- 2021-04-29 05:09
- 2楼网友:思契十里
- 2021-04-29 04:35
Private Sub Command1_Click() Me.Hide Form2.Show Command1.Enabled = False End Sub
Private Sub Form_DblClick() Dim r, g, b As Integer r = Int(Rnd * 255 + 1) g = Int(Rnd * 255 + 1) b = Int(Rnd * 255 + 1) Form1.Picture = LoadPicture("") Form1.BackColor = RGB(r, g, b) Debug.Print r, g, b End Sub
Private Sub Form_Load() Form1.Picture = LoadPicture(App.Path & "\win.jpg") End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) MsgBox "拜拜" Form2.Show End Sub
把win.jpg放到程序的根目录下就可以了