FANDOM


Public Class Form1
Dim Fonts As New System.Drawing.Text.InstalledFontCollection

Private Sub LblFontDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LblFontDisplay.Click

End Sub

Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value)
End Sub

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MessageBox.Show("Are you sure you want to quit now?", "Confirm Quit?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = vbNo Then e.Cancel = True
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Font_name As FontFamily

For Each Font_name In Fonts.Families
CboFonts.Items.Add(Font_name.Name)
Next
CboFonts.SelectedIndex = 0
LblCounter.Text = "Available Fonts: " & CboFonts.Items.Count
End Sub

Private Sub CboFonts_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CboFonts.SelectedIndexChanged
On Error Resume Next
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value)
End Sub

Private Sub RdoBold_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RdoBold.CheckedChanged
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value, FontStyle.Bold)
End Sub

Private Sub RdoItalic_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RdoItalic.CheckedChanged
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value, FontStyle.Italic)
End Sub

Private Sub RdoRegular_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RdoRegular.CheckedChanged
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value, FontStyle.Regular)
End Sub

Private Sub RdoStrikeOut_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RdoStrikeOut.CheckedChanged
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value, FontStyle.Strikeout)
End Sub

Private Sub RdoUnderline_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RdoUnderline.CheckedChanged
LblFontDisplay.Font = New Font(CboFonts.Text, TrackBar1.Value, FontStyle.Underline)
End Sub

Private Sub BtnColors_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnColors.Click
Dim DlgColor As New ColorDialog

DlgColor.FullOpen = True
If DlgColor.ShowDialog = vbOK Then
LblFontDisplay.ForeColor = DlgColor.Color
End If
End Sub

Private Sub BtnFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFont.Click
Dim DlgFont As New FontDialog
On Error Resume Next
If DlgFont.ShowDialog = vbOK Then
LblFontDisplay.Font = DlgFont.Font
End If
End Sub

Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click
If MessageBox.Show("Are you sure you want to quit now?", "Confirm Quit", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = vbYes Then End
End Sub

Private Sub FontDialog1_Apply(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontDialog1.Apply

End Sub
End Class

Public Class Form1(Peripherals)
Sub Level1()
lblCam.ForeColor = Color.Blue
LblCamStat.ForeColor = Color.Blue
lblPrinter.ForeColor = Color.Blue
lblPrintStat.ForeColor = Color.Blue
lblScanner.ForeColor = Color.Blue
lblScannerStat.ForeColor = Color.Blue
lblLevel.ForeColor = Color.Blue
lblLevelStat.ForeColor = Color.Blue
lblLevelStat.Text = "Level 1"
End Sub
Sub Level2()
lblCam.ForeColor = Color.green
LblCamStat.ForeColor = Color.Green
lblPrinter.ForeColor = Color.Green
lblPrintStat.ForeColor = Color.green
lblScanner.ForeColor = Color.green
lblScannerStat.ForeColor = Color.green
lblLevel.ForeColor = Color.green
lblLevelStat.ForeColor = Color.green
lblLevelStat.Text = "Level 2"
End Sub
Sub Level3()
lblCam.ForeColor = Color.Red
LblCamStat.ForeColor = Color.Red
lblPrinter.ForeColor = Color.Red
lblPrintStat.ForeColor = Color.Red
lblScanner.ForeColor = Color.Red
lblScannerStat.ForeColor = Color.Red
lblLevel.ForeColor = Color.Red
lblLevelStat.ForeColor = Color.Red
lblLevelStat.Text = "Level 3"
End Sub

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
Level1()
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
Level2()
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
Level3()
End Sub

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
LblCamStat.Text = "ON"
Else
LblCamStat.Text = "OFF"
End If
End Sub

Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
If CheckBox2.Checked = True Then
lblScannerStat.Text = "ON"
Else
lblScannerStat.Text = "OFF"
End If
End Sub

Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
If CheckBox3.Checked = True Then
lblPrintStat.Text = "ON"
Else
lblPrintStat.Text = "OFF"
End If
End Sub

Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
If MessageBox.Show("Thank you for using the program, programmed by: Michael Catacutan", "Program Closed!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) = vbOK Then End
End Sub

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MessageBox.Show("Are you sure you want to quit now?", "Confirm Quit?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = vbNo Then e.Cancel = True
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.