急求VB程序

来源:百度知道 编辑:UC知道 时间:2024/05/09 04:44:01
1编写简单的文本编辑器程序(自选实现方式:菜单、按钮)
2编写调色板程序
3编写飞翔的蝴蝶(奔跑的小汽车)程序
4编写绘制简单的函数图像(画正弦曲线)程序
5编写跳动的图形(冰球运动)程序

1
Private Sub b_Click(Index As Integer)
CommonDialog1.Filter = "所有文件|*.*|word文档| * .doc|位图文件|*.bmp|文本文件|*.txt"
CommonDialog1.FilterIndex = 4
CommonDialog1.CancelError = True
On Error GoTo err
CommonDialog1.Action = 1
Text1.Text = ""
Dim a As String
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, a
Text1.Text = Text1.Text + a
Loop
Close #1
err:
End Sub

Private Sub c_Click(Index As Integer)
CommonDialog1.Filter = "所有文件|*.*|word文档| * .doc|位图文件|*.bmp|文本文件|*.txt"
CommonDialog1.FilterIndex = 4
CommonDialog1.CancelError = True
On Error GoTo err
CommonDialog1.Action = 2
Open CommonDialog1.FileName For Output As #1
Print #1, Text1.Text
Close #1
err:
End Sub

Private Sub cha_Click()
mka = Text1.SelText
mkb = Text1.Text
mkd = Text1.SelStart
Form2.Show
End Sub