Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Codici - ascii.vb

ascii.vb

Caricato da:
Scarica il programma completo

  1. Public Class ascii
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Codice generato da Progettazione Windows Form "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'Chiamata richiesta da Progettazione Windows Form.
  10.         InitializeComponent()
  11.  
  12.         'Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent()
  13.  
  14.     End Sub
  15.  
  16.     'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
  17.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  18.         If disposing Then
  19.             If Not (components Is Nothing) Then
  20.                 components.Dispose()
  21.             End If
  22.         End If
  23.         MyBase.Dispose(disposing)
  24.     End Sub
  25.  
  26.     'Richiesto da Progettazione Windows Form
  27.     Private components As System.ComponentModel.IContainer
  28.  
  29.     'NOTA: la procedura che segue è richiesta da Progettazione Windows Form.
  30.     'Può essere modificata in Progettazione Windows Form.  
  31.     'Non modificarla nell'editor del codice.
  32.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  33.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  34.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  35.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(ascii))
  36.         Me.TextBox1 = New System.Windows.Forms.TextBox
  37.         Me.TextBox2 = New System.Windows.Forms.TextBox
  38.         Me.SuspendLayout()
  39.         '
  40.         'TextBox1
  41.         '
  42.         Me.TextBox1.BackColor = System.Drawing.Color.White
  43.         Me.TextBox1.Location = New System.Drawing.Point(88, 8)
  44.         Me.TextBox1.MaxLength = 1
  45.         Me.TextBox1.Name = "TextBox1"
  46.         Me.TextBox1.Size = New System.Drawing.Size(24, 20)
  47.         Me.TextBox1.TabIndex = 3
  48.         Me.TextBox1.Text = ""
  49.         Me.TextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  50.         '
  51.         'TextBox2
  52.         '
  53.         Me.TextBox2.BackColor = System.Drawing.Color.White
  54.         Me.TextBox2.Location = New System.Drawing.Point(120, 8)
  55.         Me.TextBox2.MaxLength = 1
  56.         Me.TextBox2.Name = "TextBox2"
  57.         Me.TextBox2.ReadOnly = True
  58.         Me.TextBox2.Size = New System.Drawing.Size(48, 20)
  59.         Me.TextBox2.TabIndex = 4
  60.         Me.TextBox2.Text = ""
  61.         Me.TextBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  62.         '
  63.         'ascii
  64.         '
  65.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  66.         Me.ClientSize = New System.Drawing.Size(254, 36)
  67.         Me.Controls.Add(Me.TextBox2)
  68.         Me.Controls.Add(Me.TextBox1)
  69.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
  70.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  71.         Me.MaximizeBox = False
  72.         Me.Name = "ascii"
  73.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  74.         Me.Text = "Ascii"
  75.         Me.ResumeLayout(False)
  76.  
  77.     End Sub
  78.  
  79. #End Region
  80.  
  81.     Private Sub Form7_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
  82.         Dim iniz As New iniz
  83.         iniz.Show()
  84.     End Sub
  85.  
  86.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  87.         Select Case TextBox1.Text
  88.             Case " "
  89.                 TextBox2.Text = "32"
  90.                 TextBox1.SelectAll()
  91.             Case "!"
  92.                 TextBox2.Text = "33"
  93.                 TextBox1.SelectAll()
  94.             Case "#"
  95.                 TextBox2.Text = "35"
  96.                 TextBox1.SelectAll()
  97.             Case "$"
  98.                 TextBox2.Text = "36"
  99.                 TextBox1.SelectAll()
  100.             Case "%"
  101.                 TextBox2.Text = "37"
  102.                 TextBox1.SelectAll()
  103.             Case "&"
  104.                 TextBox2.Text = "38"
  105.                 TextBox1.SelectAll()
  106.             Case "'"
  107.                 TextBox2.Text = "39"
  108.                 TextBox1.SelectAll()
  109.             Case "("
  110.                 TextBox2.Text = "40"
  111.                 TextBox1.SelectAll()
  112.             Case ")"
  113.                 TextBox2.Text = "41"
  114.                 TextBox1.SelectAll()
  115.             Case "*"
  116.                 TextBox2.Text = "42"
  117.                 TextBox1.SelectAll()
  118.             Case "+"
  119.                 TextBox2.Text = "43"
  120.                 TextBox1.SelectAll()
  121.             Case ","
  122.                 TextBox2.Text = "44"
  123.                 TextBox1.SelectAll()
  124.             Case "-"
  125.                 TextBox2.Text = "45"
  126.                 TextBox1.SelectAll()
  127.             Case "."
  128.                 TextBox2.Text = "46"
  129.                 TextBox1.SelectAll()
  130.             Case "/"
  131.                 TextBox2.Text = "47"
  132.                 TextBox1.SelectAll()
  133.             Case "0"
  134.                 TextBox2.Text = "48"
  135.                 TextBox1.SelectAll()
  136.             Case "1"
  137.                 TextBox2.Text = "49"
  138.                 TextBox1.SelectAll()
  139.             Case "2"
  140.                 TextBox2.Text = "50"
  141.                 TextBox1.SelectAll()
  142.             Case "3"
  143.                 TextBox2.Text = "51"
  144.                 TextBox1.SelectAll()
  145.             Case "4"
  146.                 TextBox2.Text = "52"
  147.                 TextBox1.SelectAll()
  148.             Case "5"
  149.                 TextBox2.Text = "53"
  150.                 TextBox1.SelectAll()
  151.             Case "6"
  152.                 TextBox2.Text = "54"
  153.                 TextBox1.SelectAll()
  154.             Case "7"
  155.                 TextBox2.Text = "55"
  156.                 TextBox1.SelectAll()
  157.             Case "8"
  158.                 TextBox2.Text = "56"
  159.                 TextBox1.SelectAll()
  160.             Case "9"
  161.                 TextBox2.Text = "57"
  162.                 TextBox1.SelectAll()
  163.             Case ":"
  164.                 TextBox2.Text = "58"
  165.                 TextBox1.SelectAll()
  166.             Case ";"
  167.                 TextBox2.Text = "59"
  168.                 TextBox1.SelectAll()
  169.             Case "<"
  170.                 TextBox2.Text = "60"
  171.                 TextBox1.SelectAll()
  172.             Case "="
  173.                 TextBox2.Text = "61"
  174.                 TextBox1.SelectAll()
  175.             Case ">"
  176.                 TextBox2.Text = "62"
  177.                 TextBox1.SelectAll()
  178.             Case "?"
  179.                 TextBox2.Text = "63"
  180.                 TextBox1.SelectAll()
  181.             Case "@"
  182.                 TextBox2.Text = "64"
  183.                 TextBox1.SelectAll()
  184.             Case "A"
  185.                 TextBox2.Text = "65"
  186.                 TextBox1.SelectAll()
  187.             Case "B"
  188.                 TextBox2.Text = "66"
  189.                 TextBox1.SelectAll()
  190.             Case "C"
  191.                 TextBox2.Text = "67"
  192.                 TextBox1.SelectAll()
  193.             Case "D"
  194.                 TextBox2.Text = "68"
  195.                 TextBox1.SelectAll()
  196.             Case "E"
  197.                 TextBox2.Text = "69"
  198.                 TextBox1.SelectAll()
  199.             Case "F"
  200.                 TextBox2.Text = "70"
  201.                 TextBox1.SelectAll()
  202.             Case "G"
  203.                 TextBox2.Text = "71"
  204.                 TextBox1.SelectAll()
  205.             Case "H"
  206.                 TextBox2.Text = "72"
  207.                 TextBox1.SelectAll()
  208.             Case "I"
  209.                 TextBox2.Text = "73"
  210.                 TextBox1.SelectAll()
  211.             Case "J"
  212.                 TextBox2.Text = "74"
  213.                 TextBox1.SelectAll()
  214.             Case "K"
  215.                 TextBox2.Text = "75"
  216.                 TextBox1.SelectAll()
  217.             Case "L"
  218.                 TextBox2.Text = "76"
  219.                 TextBox1.SelectAll()
  220.             Case "M"
  221.                 TextBox2.Text = "77"
  222.                 TextBox1.SelectAll()
  223.             Case "N"
  224.                 TextBox2.Text = "78"
  225.                 TextBox1.SelectAll()
  226.             Case "O"
  227.                 TextBox2.Text = "79"
  228.                 TextBox1.SelectAll()
  229.             Case "P"
  230.                 TextBox2.Text = "80"
  231.                 TextBox1.SelectAll()
  232.             Case "Q"
  233.                 TextBox2.Text = "81"
  234.                 TextBox1.SelectAll()
  235.             Case "R"
  236.                 TextBox2.Text = "82"
  237.                 TextBox1.SelectAll()
  238.             Case "S"
  239.                 TextBox2.Text = "83"
  240.                 TextBox1.SelectAll()
  241.             Case "T"
  242.                 TextBox2.Text = "84"
  243.                 TextBox1.SelectAll()
  244.             Case "U"
  245.                 TextBox2.Text = "85"
  246.                 TextBox1.SelectAll()
  247.             Case "V"
  248.                 TextBox2.Text = "86"
  249.                 TextBox1.SelectAll()
  250.             Case "W"
  251.                 TextBox2.Text = "87"
  252.                 TextBox1.SelectAll()
  253.             Case "X"
  254.                 TextBox2.Text = "88"
  255.                 TextBox1.SelectAll()
  256.             Case "Y"
  257.                 TextBox2.Text = "89"
  258.                 TextBox1.SelectAll()
  259.             Case "Z"
  260.                 TextBox2.Text = "90"
  261.                 TextBox1.SelectAll()
  262.             Case "["
  263.                 TextBox2.Text = "91"
  264.                 TextBox1.SelectAll()
  265.             Case "\"
  266.                 TextBox2.Text = "92"
  267.                 TextBox1.SelectAll()
  268.             Case "]"
  269.                 TextBox2.Text = "93"
  270.                 TextBox1.SelectAll()
  271.             Case "^"
  272.                 TextBox2.Text = "94"
  273.                 TextBox1.SelectAll()
  274.             Case "_"
  275.                 TextBox2.Text = "95"
  276.                 TextBox1.SelectAll()
  277.             Case "`"
  278.                 TextBox2.Text = "96"
  279.                 TextBox1.SelectAll()
  280.             Case "a"
  281.                 TextBox2.Text = "97"
  282.                 TextBox1.SelectAll()
  283.             Case "b"
  284.                 TextBox2.Text = "98"
  285.                 TextBox1.SelectAll()
  286.             Case "c"
  287.                 TextBox2.Text = "99"
  288.                 TextBox1.SelectAll()
  289.             Case "d"
  290.                 TextBox2.Text = "100"
  291.                 TextBox1.SelectAll()
  292.             Case "e"
  293.                 TextBox2.Text = "101"
  294.                 TextBox1.SelectAll()
  295.             Case "f"
  296.                 TextBox2.Text = "102"
  297.                 TextBox1.SelectAll()
  298.             Case "g"
  299.                 TextBox2.Text = "103"
  300.                 TextBox1.SelectAll()
  301.             Case "h"
  302.                 TextBox2.Text = "104"
  303.                 TextBox1.SelectAll()
  304.             Case "i"
  305.                 TextBox2.Text = "105"
  306.                 TextBox1.SelectAll()
  307.             Case "j"
  308.                 TextBox2.Text = "106"
  309.                 TextBox1.SelectAll()
  310.             Case "k"
  311.                 TextBox2.Text = "107"
  312.                 TextBox1.SelectAll()
  313.             Case "l"
  314.                 TextBox2.Text = "108"
  315.                 TextBox1.SelectAll()
  316.             Case "m"
  317.                 TextBox2.Text = "109"
  318.                 TextBox1.SelectAll()
  319.             Case "n"
  320.                 TextBox2.Text = "110"
  321.                 TextBox1.SelectAll()
  322.             Case "o"
  323.                 TextBox2.Text = "111"
  324.                 TextBox1.SelectAll()
  325.             Case "p"
  326.                 TextBox2.Text = "112"
  327.                 TextBox1.SelectAll()
  328.             Case "q"
  329.                 TextBox2.Text = "113"
  330.                 TextBox1.SelectAll()
  331.             Case "r"
  332.                 TextBox2.Text = "114"
  333.                 TextBox1.SelectAll()
  334.             Case "s"
  335.                 TextBox2.Text = "115"
  336.                 TextBox1.SelectAll()
  337.             Case "t"
  338.                 TextBox2.Text = "116"
  339.                 TextBox1.SelectAll()
  340.             Case "u"
  341.                 TextBox2.Text = "117"
  342.                 TextBox1.SelectAll()
  343.             Case "v"
  344.                 TextBox2.Text = "118"
  345.                 TextBox1.SelectAll()
  346.             Case "w"
  347.                 TextBox2.Text = "119"
  348.                 TextBox1.SelectAll()
  349.             Case "x"
  350.                 TextBox2.Text = "120"
  351.                 TextBox1.SelectAll()
  352.             Case "y"
  353.                 TextBox2.Text = "121"
  354.                 TextBox1.SelectAll()
  355.             Case "z"
  356.                 TextBox2.Text = "122"
  357.                 TextBox1.SelectAll()
  358.             Case "{"
  359.                 TextBox2.Text = "123"
  360.                 TextBox1.SelectAll()
  361.             Case "|"
  362.                 TextBox2.Text = "124"
  363.                 TextBox1.SelectAll()
  364.             Case "}"
  365.                 TextBox2.Text = "125"
  366.                 TextBox1.SelectAll()
  367.             Case "~"
  368.                 TextBox2.Text = "126"
  369.                 TextBox1.SelectAll()
  370.             Case Else
  371.                 MsgBox("Mi spiace ma questo carattere non è ammesso", MsgBoxStyle.Critical, Me.Text)
  372.         End Select
  373.     End Sub
  374.  
  375.     Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  376.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  377.     End Sub
  378.  
  379.     Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
  380.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  381.     End Sub
  382. End Class