重做网格
Private Sub Command1_Click()
Form1.Refresh
Dim w, h As Integer
Dim x, y As Integer
Dim i As Integer
w = Form1.ScaleWidth
h = Form1.ScaleHeight
x = Int(w / Val(Combo1.Text))
y = Int(h / Val(Combo2.Text))
For i = 1 To Combo1.Text + 1
Line (x * i, 0)-(x * i, h)
Next
For i = 1 To Combo2.Text + 1
Line (0, y * i)-(w, y * i)
Next
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 500
Combo1.AddItem (i)
Combo2.AddItem (i)
Next
End Sub
播放音乐
Private Sub Form_Load()
With MMControl1
.Visible = False
.FileName = "C:\Users\Qi\Desktop\01.mp3"
.Command = "open"
.Command = "play"
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.MMControl1.Command = "close"
End Sub
MMcontrol控件
Private Sub Form_Load()
With MMControl1
.FileName = "C:\Users\Qi\Desktop\仙境传说.mp3"
.Command = "open"
.Command = "play"
End With
If Form1.MMControl1.Error Then
MsgBox Form1.MMControl1.ErrorMessage, vbCritical, "未安装CD播放器或CD播放器不能正常工作"
End If
End Sub
Private Sub MMControl1_Done(NotifyCode As Integer)
Select Case MMControl1.Mode
Case 524
Label1.Caption = "设备没有打开"
Case 525
Label1.Caption = "停止"
Case 526
Label1.Caption = "正在播放"
Case 527
Label1.Caption = "正在录制"
Case 528
Label1.Caption = "正在搜索"
Case 529
Label1.Caption = "暂停"
Case 530
Label1.Caption = "设备准备好"
End Select
End Sub
Private Sub form_unload(cancel As Integer)
Form1.MMControl1.Command = "close"
End Sub
Private Sub MMControl1_StatusUpdate()
Label2.Caption = "当前曲目: " & Str$(MMControl1.Track)
End Sub