form1里面的代码:
Public Class Form1
Private Sub PictureBox9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox9.Click
End
End Sub
Private Sub PictureBox10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox10.Click
Dim f2 As New Form2
Me.Hide()
f2.ShowDialog()
End Sub
Private Sub PictureBox13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox13.Click
Dim f3 As New Form3
'Me.Hide()
f3.ShowDialog()
End Sub
Private Sub PictureBox16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox16.Click
Dim f4 As New Form4
'Me.Hide()
f4.ShowDialog()
End Sub
Private Sub PictureBox11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox11.Click
Dim f5 As New Form5
f5.ShowDialog()
End Sub
Private Sub PictureBox17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox17.Click
Dim f6 As New Form6
f6.ShowDialog()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1.Enabled = True
End Sub
Private Sub PictureBox12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox12.Click
Dim f8 As New Form8
f8.ShowDialog()
End Sub
Private Sub PictureBox15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox15.Click
End Sub
Private Sub PictureBox18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox18.Click
End Sub
Private Sub PictureBox14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox14.Click
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.PictureBox1.Top >= Me.Height Then Me.PictureBox1.Top = -Me.PictureBox1.Height
Me.PictureBox1.Top = Me.PictureBox1.Top + h
If Me.PictureBox2.Top <= -Me.PictureBox1.Height Then Me.PictureBox2.Top = Me.Height
Me.PictureBox2.Top = Me.PictureBox2.Top - h
If Me.PictureBox3.Left >= Me.Width Then Me.PictureBox3.Left = -Me.PictureBox3.Width
Me.PictureBox3.Left = Me.PictureBox3.Left + w
If Me.PictureBox4.Left <= -Me.PictureBox3.Width Then Me.PictureBox4.Left = Me.Width
Me.PictureBox4.Left = Me.PictureBox4.Left - w
If Me.PictureBox5.Top >= Me.Height Then Me.PictureBox5.Top = -Me.PictureBox1.Height : Me.PictureBox5.Left = 0
Me.PictureBox5.Left = Me.PictureBox5.Left + w
Me.PictureBox5.Top = Me.PictureBox5.Top + h
If Me.PictureBox6.Top >= Me.Height Then Me.PictureBox6.Top = 0 : Me.PictureBox6.Left = Me.Width - Me.PictureBox6.Width
Me.PictureBox6.Top = Me.PictureBox6.Top + h
Me.PictureBox6.Left = Me.PictureBox6.Left - w
If Me.PictureBox7.Left >= Me.Width Then Me.PictureBox7.Left = 0 : Me.PictureBox7.Top = Me.Height
Me.PictureBox7.Top = Me.PictureBox7.Top - h
Me.PictureBox7.Left = Me.PictureBox7.Left + w
If Me.PictureBox8.Top <= 0 Then Me.PictureBox8.Top = Me.Height : Me.PictureBox8.Left = Me.Width
Me.PictureBox8.Top = Me.PictureBox8.Top - h
Me.PictureBox8.Left = Me.PictureBox8.Left - w
End Sub
End Class
form2里面的代码:
Public Class Form2
Private Sub AxWindowsMediaPlayer1_ClickEvent(ByVal sender As System.Object, ByVal e As AxWMPLib._WMPOCXEvents_ClickEvent) Handles AxWindowsMediaPlayer1.ClickEvent
Me.AxWindowsMediaPlayer1.URL = ""
End Sub
Private Sub 打开ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开ToolStripMenuItem.Click
If Me.OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim file1 As String
file1 = Me.OpenFileDialog1.FileName
Me.AxWindowsMediaPlayer1.URL = file1
End If
End Sub
Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click
Me.Close()
Form1.Show()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'If Me.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink Then
'if me.
End Sub
Private Sub 正常模式ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 正常模式ToolStripMenuItem.Click
Me.AxWindowsMediaPlayer1.fullScreen = False
End Sub
Private Sub 全屏ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 全屏ToolStripMenuItem.Click
Me.AxWindowsMediaPlayer1.fullScreen = True
End Sub
End Class
form4里面的代码:
Public Class Form4
'Public Static i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Button1.Text = "开始(&S)" Then
Button1.Text = "暂停(&T)"
Timer1.Enabled = True
Else
Button1.Text = "开始(&S)"
Timer1.Enabled = False
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'Static i As Integer
i = i + 1
Label1.Text = CStr(i)
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If Label2.Left > Me.Width Then Me.Label2.Left = 0
Label2.Left = Me.Label2.Left + 40
If Label3.Left < 0 Then Me.Label3.Left = Me.Width
Label3.Left = Me.Label3.Left - 40
End Sub
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'Timer1.Enabled = False
'Timer2.Enabled = True
i = 1
Label1.Text = 1
End Sub
End Class
form5里面的代码:
Imports System.IO
Public Class Form5
Dim g_press As Boolean
Private Sub 剪切ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 剪切ToolStripMenuItem.Click
Me.TextBox1.Cut()
End Sub
Private Sub 撤消ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 撤消ToolStripMenuItem.Click
g_press = True
Me.TextBox1.ClearUndo()
End Sub
Private Sub 复制ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 复制ToolStripMenuItem.Click
Me.TextBox1.Copy()
End Sub
Private Sub 全选ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 全选ToolStripMenuItem.Click
Me.TextBox1.SelectAll()
End Sub
Private Sub 退出ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 退出ToolStripMenuItem.Click
Dim bt As Integer
If TextBox1.Text <> "" Then
bt = MsgBox("文件 无标题 的文字已经有了改变" & vbCrLf & "要保存该文件吗?", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation + MsgBoxStyle.DefaultButton1, "记事本")
If bt = 6 Then
If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim swfile As String
swfile = Me.SaveFileDialog1.FileName
Dim duru As New StreamWriter(swfile, True)
duru.Write(TextBox1.Text)
duru.Close()
TextBox1.Clear()
End If
End If
If bt = 7 Then
TextBox1.Clear()
End If
End If
'End
Me.Close()
End Sub
Private Sub 粘贴ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 粘贴ToolStripMenuItem.Click
Me.TextBox1.Paste()
End Sub
Private Sub 删除ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 删除ToolStripMenuItem.Click
Me.TextBox1.SelectedText = ""
End Sub
Private Sub 新建ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 新建ToolStripMenuItem.Click
Dim bt As Integer
If TextBox1.Text <> "" Then
bt = MsgBox("文件 无标题 的文字已经有了改变" & vbCrLf & "要保存该文件吗?", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation + MsgBoxStyle.DefaultButton1, "记事本")
If bt = 6 Then
If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim swfile As String
swfile = Me.SaveFileDialog1.FileName
Dim duru As New StreamWriter(swfile, True)
duru.Write(TextBox1.Text)
duru.Close()
TextBox1.Clear()
End If
End If
If bt = 7 Then
TextBox1.Clear()
End If
End If
End Sub
Private Sub 自动换行ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 自动换行ToolStripMenuItem.Click
If 自动换行ToolStripMenuItem.Checked = True Then
自动换行ToolStripMenuItem.Checked = False
Me.TextBox1.WordWrap = False
Else : 自动换行ToolStripMenuItem.Checked = True
Me.TextBox1.WordWrap = True
End If
End Sub
Private Sub 字体ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 字体ToolStripMenuItem.Click
If Me.FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.TextBox1.Font = Me.FontDialog1.Font
End If
End Sub
Private Sub 左对齐ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 左对齐ToolStripMenuItem.Click
Me.TextBox1.TextAlign = HorizontalAlignment.Left
End Sub
Private Sub 右对齐ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 右对齐ToolStripMenuItem.Click
Me.TextBox1.TextAlign = HorizontalAlignment.Right
End Sub
Private Sub 居中对齐ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 居中对齐ToolStripMenuItem.Click
Me.TextBox1.TextAlign = HorizontalAlignment.Center
End Sub
Private Sub 保存ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 保存ToolStripMenuItem.Click
Dim bt As Integer
If TextBox1.Text <> "" Then
'bt = MsgBox("文件 无标题 的文字已经有了改变" & vbCrLf & "要保存该文件吗?", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation + MsgBoxStyle.DefaultButton1, "记事本")
'If bt = 6 Then
If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim swfile As String
swfile = Me.SaveFileDialog1.FileName
Dim duru As New StreamWriter(swfile, True)
duru.Write(TextBox1.Text)
duru.Close()
TextBox1.Clear()
End If
End If
'If bt = 7 Then
' TextBox1.Clear()
'End If
'End If
'' '' '' ''If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
'' '' '' '' Dim swfile As String
'' '' '' '' swfile = Me.SaveFileDialog1.FileName
'' '' '' '' Dim duru As New StreamWriter(swfile, True)
'' '' '' '' duru.Write(TextBox1.Text)
'' '' '' '' duru.Close()
'' '' '' ''End If
End Sub
Private Sub 另存为ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 另存为ToolStripMenuItem.Click
'' '' '' '' ''If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
'' '' '' '' '' Dim swfile As String
'' '' '' '' '' swfile = Me.SaveFileDialog1.FileName
'' '' '' '' '' Dim duru As New StreamWriter(swfile, True)
'' '' '' '' '' duru.Write(TextBox1.Text)
'' '' '' '' '' duru.Close()
'' '' '' '' ''End If
'Dim bt As Integer
'If TextBox1.Text <> "" Then
' bt = MsgBox("文件 无标题 的文字已经有了改变" & vbCrLf & "要保存该文件吗?", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Critical + MsgBoxStyle.DefaultButton1, "记事本")
' If bt = 6 Then
If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim swfile As String
swfile = Me.SaveFileDialog1.FileName
Dim duru As New StreamWriter(swfile, True)
duru.Write(TextBox1.Text)
duru.Close()
TextBox1.Clear()
End If
'End If
'If bt = 7 Then
' TextBox1.Clear()
'End If
'End If
End Sub
Private Sub 打开ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 打开ToolStripMenuItem.Click
Dim bt As Integer
If TextBox1.Text <> "" Then
bt = MsgBox("文件 无标题 的文字已经有了改变" & vbCrLf & "要保存该文件吗?", MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation + MsgBoxStyle.DefaultButton1, "记事本")
If bt = 2 Then Exit Sub
If bt = 6 Then
If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Me.SaveFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
Dim swfile As String
swfile = Me.SaveFileDialog1.FileName
Dim duru As New StreamWriter(swfile, True)
duru.Write(TextBox1.Text)
duru.Close()
TextBox1.Clear()
End If
End If
If bt = 7 Then
TextBox1.Clear()
End If
'Dim pathname, str As String
'Me.OpenFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
'If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
' pathname = Me.OpenFileDialog1.FileName
' Dim srfile As StreamReader
' srfile = File.OpenText(pathname)
' TextBox1.Text = srfile.ReadToEnd()
' srfile.Close()
'End If
''if
Dim du As StreamReader
End If
Dim pathname, str As String
Me.OpenFileDialog1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"
If Me.OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
pathname = Me.OpenFileDialog1.FileName
Dim srfile As StreamReader
srfile = File.OpenText(pathname)
TextBox1.Text = srfile.ReadToEnd()
srfile.Close()
End If
'if
End Sub
Private Sub 左对齐ToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 左对齐ToolStripMenuItem.Click
End Sub
Private Sub 时间日期ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 时间日期ToolStripMenuItem.Click
TextBox1.Text = Now
End Sub
Private Sub 字体色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 字体色ToolStripMenuItem.Click
If Me.ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.ForeColor = Me.ColorDialog1.Color
End If
End Sub
Private Sub 背景色ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 背景色ToolStripMenuItem.Click
If Me.ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.BackColor = Me.ColorDialog1.Color
End If
End Sub
Private Sub 关于记事本ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 关于记事本ToolStripMenuItem.Click
Dim f7 As New Form7
f7.ShowDialog()
End Sub
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
状态栏ToolStripMenuItem.Enabled = False
帮助主题ToolStripMenuItem.Enabled = False
查找ToolStripMenuItem.Enabled = False
替换ToolStripMenuItem.Enabled = False
End Sub
End Class
form6里面的代码:
Public Class Form6
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'If Me.Timer1.Enabled = False Then
' Timer1.Enabled = True
' Button1.Text = "停止"
'Else
' Button1.Text = "开始"
' Timer1.Enabled = False
'End If
Me.Timer1.Enabled = True
End Sub
Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
If e.KeyCode = Keys.Enter Then
Me.ComboBox1.Items.Add(Me.ComboBox1.Text)
Me.ComboBox1.Text = ""
TextBox1.Text = Me.ComboBox1.Items.Count
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim shul, geshu As Integer
Randomize()
geshu = Me.ComboBox1.Items.Count
shul = Int(Rnd() * geshu)
Me.ComboBox1.SelectedIndex = shul
Me.ComboBox1.Text = Me.ComboBox1.SelectedItem
Label4.Text = Me.ComboBox1.SelectedItem
End Sub
'Private Sub ComboBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
' If e.KeyCode = Keys.Enter Then
' Me.ComboBox1.Items.Add(Me.ComboBox1.Text)
' Me.ComboBox1.Text = ""
' TextBox1.Text = Me.ComboBox1.Items.Count
' End If
'End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Timer1.Enabled = False
Label4.Visible = False
Me.Timer2.Enabled = True
End Sub
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Timer1.Enabled = False
Me.Timer2.Enabled = False
Label5.Visible = False
Label6.Visible = False
Label7.Visible = False
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim xiansuo As Integer
xiansuo = xiansuo + 1
If xiansuo = 10 Then Exit Sub
If Label4.Visible = True Then
Label4.Visible = False
Else : Label4.Visible = True
End If
If Label5.Visible = True Then
Label5.Visible = False
Else : Label5.Visible = True
End If
If Label6.Visible = True Then
Label6.Visible = False
Else : Label6.Visible = True
End If
If Label7.Visible = True Then
Label7.Visible = False
Else : Label7.Visible = True
End If
End Sub
End Class
form7里面的代码:
Public Class Form7
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Public Class Form8
Dim in1, in2, in3, in4, in5, in6, in7, in8, in9, in10 As String
'dim
Private Sub Form8_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("待你进入了页面," & vbCrLf & "请你不要再上面" & vbCrLf & "胡乱画,信不信由你!")
in1 = InputBox("请输入你的初恋情人的名字", "科学择偶", "初恋的情人")
in2 = InputBox("请输入你想唱给他/她的一首歌", "科学择偶", "歌曲名")
in3 = InputBox("请输入你的现在情人的名字", "科学择偶", "现在的情人")
in4 = InputBox("请输入你想唱给他/她的一首歌", "科学择偶", "歌曲名")
in5 = InputBox("请输入一首你最喜欢的歌曲", "科学择偶", "歌曲的名字")
in6 = InputBox("请输入你最好的朋友的名字", "科学择偶", "最好朋友的名字")
in7 = InputBox("请再输入一个你的好朋友的名字", "科学择偶", "好朋友的名字")
in8 = InputBox("请再输入一个你的好朋友的名字", "科学择偶", "好朋友的名字")
in9 = InputBox("请输入你的心愿", "科学择偶", "你的心愿")
in10 = " 你的初恋情人" & in1 & "并不是你明智的选择,虽然你很执着,但天已经注定你们今生不可能在一起。《" & in2 & "》这首歌曲就足够表达你的苦衷。你当是一定会很迷茫,但最后你终于又遇到了" & in3 & ",你现在很爱她,这首《" & in4 & "》足以表达你对他/她的爱。" _
& "你的爱情观很特别,只一首《" & in5 & "》就可以看出。" & in6 & "是你最可靠的朋友,在恋爱上也许比你更成熟些。你可以经常问问他、" & in7 & "或者是" & in8 & "。只要你努力抓住没一个可能的机会,你的愿望――" & in9 & "――一定可以实现的!" & vbCrLf & " 祝你好运!!!"
Label1.Text = in10
End Sub
End Class
本文出自 “www.creat_hao.com.cn” 博客,转载请与作者联系!