Advertisement
Aminpro

Visual Basic Frame1

Aug 10th, 2011
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.  
  3.  
  4.  
  5.     Private Property IsNullOrEmpty As String
  6.  
  7.     Private Property DateAndTime As String
  8.  
  9.  
  10.  
  11.     'Created by Aminpro
  12.  
  13.     'Written by Aminpro
  14.    'LoL
  15.    'Do not steal!
  16.    'Seriously?
  17.  
  18.     'The main subject is the textbox input
  19.    'Textbox input name is defcon1
  20.    'Output is directly changed in defcon1
  21.    'Secondary subject is the picturebox's result
  22.    'picturebox's result is named defcon2
  23.  
  24.     'defcon1 is textbox
  25.    'defcon2 is picturebox
  26.  
  27.  
  28.     Private Sub cancelbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cancelbutton.Click
  29.         defcon1.Clear()
  30.         defcon2.Image = Nothing
  31.         arialchoose.Checked = False
  32.         calibrichoose.Checked = False
  33.         papyruschoose.Checked = False
  34.         timeschoose.Checked = False
  35.         boldcheck.CheckState = CheckState.Unchecked
  36.         italiccheck.CheckState = CheckState.Unchecked
  37.         underlinecheck.CheckState = CheckState.Unchecked
  38.         normalchoose.Checked = False
  39.         strechimagechoose.Checked = False
  40.         autosizechoose.Checked = False
  41.         centerimagechoose.Checked = False
  42.         zoomchoose.Checked = False
  43.         textoptionlabel.Text = "Text Font"
  44.         textpropertieslabel.Text = "Text Properties"
  45.         pictureoptionlabel.Text = "PictureBox Option"
  46.         picturelabel.Text = "Selected Picture"
  47.         picturelist.SelectedItem = IsNullOrEmpty
  48.         listboxlabel.Text = "Select an item"
  49.  
  50.         MsgBox("All fields have been reset")
  51.         actionlabel.Text = "Text and Picture cleared"
  52.         'Created by Aminpro
  53.  
  54.  
  55.     End Sub
  56.  
  57.     Private Sub yeahbutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles yeahbutton.Click
  58.         defcon1.Copy()
  59.         actionlabel.Text = "Text copied"
  60.         'Created by Aminpro
  61.    End Sub
  62.  
  63.     Private Sub nobutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nobutton.Click
  64.         defcon1.Paste()
  65.         actionlabel.Text = "Text pasted from clipboard"
  66.  
  67.  
  68.         'Created by Aminpro
  69.  
  70.     End Sub
  71.  
  72.     Private Sub arialchoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles arialchoose.CheckedChanged
  73.         defcon1.Font = New Font("Arial", defcon1.Font.Size)
  74.  
  75.         textoptionlabel.Text = "Arial font selected"
  76.         'Properties of the text starts here ------------
  77.  
  78.         If underlinecheck.Checked Then
  79.             defcon1.Font = New Font(defcon1.Font, FontStyle.Underline)
  80.         End If
  81.         'Created by Aminpro
  82.        If italiccheck.Checked Then
  83.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic)
  84.         End If
  85.         'Created by Aminpro
  86.        If boldcheck.Checked Then
  87.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold)
  88.         End If
  89.         'Created by Aminpro
  90.        If boldcheck.Checked And italiccheck.Checked Then
  91.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Italic)
  92.         End If
  93.         'Created by Aminpro
  94.        If boldcheck.Checked And underlinecheck.Checked Then
  95.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline)
  96.         End If
  97.         'Created by Aminpro
  98.        If italiccheck.Checked And underlinecheck.Checked Then
  99.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic Or FontStyle.Underline)
  100.         End If
  101.         'Created by Aminpro
  102.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  103.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Italic)
  104.         End If
  105.         'Created by Aminpro
  106.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  107.             defcon1.Font = New Font(defcon1.Font, FontStyle.Regular)
  108.  
  109.         End If
  110.         'Created by Aminpro
  111.    End Sub
  112.  
  113.     Private Sub calibrichoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calibrichoose.CheckedChanged
  114.         defcon1.Font = New Font("calibri", defcon1.Font.Size)
  115.  
  116.         textoptionlabel.Text = "Calibri font selected"
  117.         'Properties of the text starts here ------------
  118.  
  119.         If underlinecheck.Checked Then
  120.             defcon1.Font = New Font(defcon1.Font, FontStyle.Underline)
  121.         End If
  122.         'Created by Aminpro
  123.        If italiccheck.Checked Then
  124.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic)
  125.         End If
  126.         'Created by Aminpro
  127.        If boldcheck.Checked Then
  128.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold)
  129.         End If
  130.         'Created by Aminpro
  131.        If boldcheck.Checked And italiccheck.Checked Then
  132.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Italic)
  133.         End If
  134.         'Created by Aminpro
  135.        If boldcheck.Checked And underlinecheck.Checked Then
  136.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline)
  137.         End If
  138.         'Created by Aminpro
  139.        If italiccheck.Checked And underlinecheck.Checked Then
  140.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic Or FontStyle.Underline)
  141.         End If
  142.         'Created by Aminpro
  143.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  144.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Italic)
  145.         End If
  146.         'Created by Aminpro
  147.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  148.             defcon1.Font = New Font(defcon1.Font, FontStyle.Regular)
  149.  
  150.         End If
  151.         'Created by Aminpro
  152.    End Sub
  153.  
  154.     Private Sub papyruschoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles papyruschoose.CheckedChanged
  155.         defcon1.Font = New Font("papyrus", defcon1.Font.Size)
  156.  
  157.         textoptionlabel.Text = "Papyrus font selected"
  158.         'Properties of the text starts here ------------
  159.  
  160.         If underlinecheck.Checked Then
  161.             defcon1.Font = New Font(defcon1.Font, FontStyle.Underline)
  162.         End If
  163.         'Created by Aminpro
  164.        If italiccheck.Checked Then
  165.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic)
  166.         End If
  167.         'Created by Aminpro
  168.        If boldcheck.Checked Then
  169.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold)
  170.         End If
  171.         'Created by Aminpro
  172.        If boldcheck.Checked And italiccheck.Checked Then
  173.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Italic)
  174.         End If
  175.         'Created by Aminpro
  176.        If boldcheck.Checked And underlinecheck.Checked Then
  177.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline)
  178.         End If
  179.         'Created by Aminpro
  180.        If italiccheck.Checked And underlinecheck.Checked Then
  181.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic Or FontStyle.Underline)
  182.         End If
  183.         'Created by Aminpro
  184.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  185.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Italic)
  186.         End If
  187.         'Created by Aminpro
  188.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  189.             defcon1.Font = New Font(defcon1.Font, FontStyle.Regular)
  190.  
  191.         End If
  192.         'Created by Aminpro
  193.    End Sub
  194.  
  195.     Private Sub timeschoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timeschoose.CheckedChanged
  196.         defcon1.Font = New Font("Times New Roman", defcon1.Font.Size)
  197.         textoptionlabel.Text = "Times New Roman font selected"
  198.         'Properties of the text starts here ------------
  199.  
  200.         If underlinecheck.Checked Then
  201.             defcon1.Font = New Font(defcon1.Font, FontStyle.Underline)
  202.         End If
  203.         'Created by Aminpro
  204.        If italiccheck.Checked Then
  205.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic)
  206.         End If
  207.         'Created by Aminpro
  208.        If boldcheck.Checked Then
  209.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold)
  210.         End If
  211.         'Created by Aminpro
  212.        If boldcheck.Checked And italiccheck.Checked Then
  213.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Italic)
  214.         End If
  215.         'Created by Aminpro
  216.        If boldcheck.Checked And underlinecheck.Checked Then
  217.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline)
  218.         End If
  219.         'Created by Aminpro
  220.        If italiccheck.Checked And underlinecheck.Checked Then
  221.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic Or FontStyle.Underline)
  222.         End If
  223.         'Created by Aminpro
  224.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  225.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Italic)
  226.         End If
  227.         'Created by Aminpro
  228.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  229.             defcon1.Font = New Font(defcon1.Font, FontStyle.Regular)
  230.  
  231.         End If
  232.         'Created by Aminpro
  233.    End Sub
  234.  
  235.     Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles defcon1.TextChanged, underlinecheck.CheckedChanged, italiccheck.CheckedChanged, boldcheck.CheckedChanged
  236.  
  237.         'Displays the text typed into the input box realtime
  238.  
  239.         If defcon1.Text = IsNullOrEmpty Then
  240.             originaltextlabel.Text = "Enter your text"
  241.         Else
  242.             originaltextlabel.Text = defcon1.Text
  243.         End If
  244.         'Created by Aminpro
  245.  
  246.         'Properties of the text starts here ------------
  247.  
  248.         If underlinecheck.Checked Then
  249.             defcon1.Font = New Font(defcon1.Font, FontStyle.Underline)
  250.         End If
  251.         'Created by Aminpro
  252.        If italiccheck.Checked Then
  253.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic)
  254.         End If
  255.         'Created by Aminpro
  256.        If boldcheck.Checked Then
  257.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold)
  258.         End If
  259.         'Created by Aminpro
  260.        If boldcheck.Checked And italiccheck.Checked Then
  261.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Italic)
  262.         End If
  263.         'Created by Aminpro
  264.        If boldcheck.Checked And underlinecheck.Checked Then
  265.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline)
  266.         End If
  267.         'Created by Aminpro
  268.        If italiccheck.Checked And underlinecheck.Checked Then
  269.             defcon1.Font = New Font(defcon1.Font, FontStyle.Italic Or FontStyle.Underline)
  270.         End If
  271.         'Created by Aminpro
  272.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  273.             defcon1.Font = New Font(defcon1.Font, FontStyle.Bold Or FontStyle.Underline Or FontStyle.Italic)
  274.         End If
  275.         'Created by Aminpro
  276.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  277.             defcon1.Font = New Font(defcon1.Font, FontStyle.Regular)
  278.  
  279.         End If
  280.  
  281.  
  282.         'Created by Aminpro
  283.  
  284.  
  285.     End Sub
  286.  
  287.  
  288.  
  289.     Private Sub textpropertieslabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles underlinecheck.CheckStateChanged, italiccheck.CheckStateChanged, boldcheck.CheckStateChanged
  290.  
  291.  
  292.         If underlinecheck.Checked Then
  293.             textpropertieslabel.Text = "Underline"
  294.         End If
  295.         'Created by Aminpro
  296.        If italiccheck.Checked Then
  297.             textpropertieslabel.Text = "Italic"
  298.         End If
  299.         'Created by Aminpro
  300.        If boldcheck.Checked Then
  301.             textpropertieslabel.Text = "Bold"
  302.         End If
  303.         'Created by Aminpro
  304.        If boldcheck.Checked And italiccheck.Checked Then
  305.             textpropertieslabel.Text = "Bold and Italic"
  306.         End If
  307.         'Created by Aminpro
  308.        If boldcheck.Checked And underlinecheck.Checked Then
  309.             textpropertieslabel.Text = "Bold and Underline"
  310.         End If
  311.         'Created by Aminpro
  312.        If italiccheck.Checked And underlinecheck.Checked Then
  313.             textpropertieslabel.Text = "Italic and Underline"
  314.         End If
  315.         'Created by Aminpro
  316.        If boldcheck.Checked And italiccheck.Checked And underlinecheck.Checked Then
  317.             textpropertieslabel.Text = "Bold, Italic and Underline"
  318.         End If
  319.         'Created by Aminpro
  320.        If boldcheck.CheckState = CheckState.Unchecked And italiccheck.CheckState = CheckState.Unchecked And underlinecheck.CheckState = CheckState.Unchecked Then
  321.             textpropertieslabel.Text = "Select styles to apply to text"
  322.         End If
  323.         'Created by Aminpro
  324.    End Sub
  325.  
  326.     'Created by Aminpro
  327.    Private Sub normalchoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles normalchoose.CheckedChanged
  328.         defcon2.SizeMode = PictureBoxSizeMode.Normal
  329.         pictureoptionlabel.Text = "Normal picture"
  330.  
  331.     End Sub
  332.  
  333.  
  334.     Private Sub strechimagechoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles strechimagechoose.CheckedChanged
  335.         defcon2.SizeMode = PictureBoxSizeMode.StretchImage
  336.         pictureoptionlabel.Text = "Picture streched"
  337.  
  338.     End Sub
  339.  
  340.     Private Sub autosizechoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles autosizechoose.CheckedChanged
  341.         defcon2.SizeMode = PictureBoxSizeMode.AutoSize
  342.         pictureoptionlabel.Text = "Picture size is auto"
  343.  
  344.     End Sub
  345.  
  346.     Private Sub centerimagechoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles centerimagechoose.CheckedChanged
  347.         defcon2.SizeMode = PictureBoxSizeMode.CenterImage
  348.         pictureoptionlabel.Text = "Picture is centered"
  349.  
  350.     End Sub
  351.  
  352.     Private Sub zoomchoose_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles zoomchoose.CheckedChanged
  353.         defcon2.SizeMode = PictureBoxSizeMode.Zoom
  354.         pictureoptionlabel.Text = "Picture is zoomed"
  355.  
  356.     End Sub
  357.     'images avalaible
  358.    'ipod = 0
  359.    'hybrid = 1
  360.    'bike = 2
  361.    'hack = 3
  362.    'repair = 4
  363.  
  364.     Private Sub defcon2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picturelist.SelectedValueChanged
  365.         If picturelist.SelectedItem = "iPod" Then
  366.             defcon2.Image = ImageList1.Images(0)
  367.             picturelabel.Text = picturelist.SelectedItem()
  368.         End If
  369.  
  370.         If picturelist.SelectedItem = "Hybrid" Then
  371.             defcon2.Image = ImageList1.Images(1)
  372.             picturelabel.Text = picturelist.SelectedItem()
  373.         End If
  374.  
  375.         If picturelist.SelectedItem = "Bike" Then
  376.             defcon2.Image = ImageList1.Images(2)
  377.             picturelabel.Text = picturelist.SelectedItem()
  378.         End If
  379.  
  380.         If picturelist.SelectedItem = "Hack n Dev" Then
  381.             defcon2.Image = ImageList1.Images(3)
  382.             picturelabel.Text = picturelist.SelectedItem()
  383.         End If
  384.  
  385.         If picturelist.SelectedItem = "Repair" Then
  386.             defcon2.Image = ImageList1.Images(4)
  387.             picturelabel.Text = picturelist.SelectedItem()
  388.         End If
  389.  
  390.         If picturelist.SelectedItem = "o_0" Then
  391.             defcon2.Image = ImageList1.Images(5)
  392.             picturelabel.Text = picturelist.SelectedItem()
  393.         End If
  394.     End Sub
  395.  
  396.  
  397.     Private Sub infobutton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles infobutton.Click
  398.         Dim aboutbox1 As AboutBox1
  399.         aboutbox1 = New AboutBox1()
  400.         aboutbox1.Show()
  401.         aboutbox1 = Nothing
  402.     End Sub
  403.  
  404.  
  405.     Private Sub listboxlabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedValueChanged
  406.         listboxlabel.Text = ListBox1.SelectedItem
  407.     End Sub
  408.  
  409.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  410.         Dim form3 As Form3
  411.         form3 = New Form3()
  412.         form3.Show()
  413.         form3 = Nothing
  414.     End Sub
  415. End Class
  416.  
  417. ' End LOL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement