Codes
[ Open / Close CDrom ]
Public Class Form1
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" ()
(Byval Ipcommandstring As string, ByVal IpReturnString As string,
Byval uReturnlength As long, Byval hwndCallback As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'DO
Dim oWMP = CreateObject("WMPplayer.OCX.7")
Dim colCDROMs = oWMP.cdromCollection
If colCDROMs.count >= 1 Then
For i = 0 To colCDROMs.count - 1
colCDROMs.item(i).Eject()
Next ' cdrom
End If
'Loop
End Sub
Private Sub Button2_click(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles Button2_click
mciSendString("Set CDAudio Door Closed", 0&, 0, 0)
End Sub
End Class
[ Notepad -Advanced- ]
Public Class Form4
Private Sub ÖppnaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ÖppnaToolStripMenuItem.Click
Dim Open As New OpenFileDialog() ' Creates a ew Open File Dialog
Dim myStreamReader As System.IO.StreamReader
Open.Filter = "Text [*.txt*] |*.txt|All Files [*.*]|*-*" 'File Filter
Open.CheckFileExists = True ' Checks if file exists
Open.Title = "Open File" ' Sets the dialog title
Open.ShowDialog(Me) 'Opens the open file dialog
Try
Open.OpenFile()
myStreamReader = System.IO.File.OpenText(Open.FileName)
Document.Text = myStreamReader.ReadToEnd()
Catch ex As Exception
' Do Noting on exception
End Try
End Sub
Private Sub SparaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SparaToolStripMenuItem.Click
Dim Save As New SaveFileDialog()
Dim myStreamWriter As System.IO.StreamWriter
Save.Filter = "Text (*.txt)|*.txt|HTML (*.html*)|*.html|PHP (*.php*)|*php*|All Files (*.*)|*-*"
Save.CheckPathExists = True
Save.Title = "Save File"
Save.ShowDialog(Me)
Try
myStreamWriter = System.IO.File.AppendText(Save.FileName)
myStreamWriter.Write(Document.Text)
myStreamWriter.Flush()
Catch ex As Exception
' Do nothing on Exception
End Try
End Sub
Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UndoToolStripMenuItem.Click
Document.Undo()
End Sub
Private Sub RedoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RedoToolStripMenuItem.Click
Document.Redo()
End Sub
Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
Document.Copy()
End Sub
Private Sub PastToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PastToolStripMenuItem.Click
Document.Paste()
End Sub
Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click
Document.Cut()
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("No fonts it will come. program made by GP")
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
[ Clock -Need to double click on it- ]
Public Class Form2
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Timer1.Interval = 10
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = TimeOfDay
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class

