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 - baudot.vb

baudot.vb

Caricato da:
Scarica il programma completo

  1. Public Class baudot
  2.     Inherits System.Windows.Forms.Form
  3.     Dim a As Integer = 0
  4.     Dim b As String
  5.     Dim controllo As Boolean
  6.  
  7. #Region " Codice generato da Progettazione Windows Form "
  8.  
  9.     Public Sub New()
  10.         MyBase.New()
  11.  
  12.         'Chiamata richiesta da Progettazione Windows Form.
  13.         InitializeComponent()
  14.  
  15.         'Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent()
  16.  
  17.     End Sub
  18.  
  19.     'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
  20.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  21.         If disposing Then
  22.             If Not (components Is Nothing) Then
  23.                 components.Dispose()
  24.             End If
  25.         End If
  26.         MyBase.Dispose(disposing)
  27.     End Sub
  28.  
  29.     'Richiesto da Progettazione Windows Form
  30.     Private components As System.ComponentModel.IContainer
  31.  
  32.     'NOTA: la procedura che segue è richiesta da Progettazione Windows Form.
  33.     'Può essere modificata in Progettazione Windows Form.  
  34.     'Non modificarla nell'editor del codice.
  35.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  36.     Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
  37.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  38.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  39.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(baudot))
  40.         Me.TextBox3 = New System.Windows.Forms.TextBox
  41.         Me.TextBox1 = New System.Windows.Forms.TextBox
  42.         Me.TextBox2 = New System.Windows.Forms.TextBox
  43.         Me.SuspendLayout()
  44.         '
  45.         'TextBox3
  46.         '
  47.         Me.TextBox3.BackColor = System.Drawing.Color.White
  48.         Me.TextBox3.Location = New System.Drawing.Point(40, 8)
  49.         Me.TextBox3.MaxLength = 1
  50.         Me.TextBox3.Name = "TextBox3"
  51.         Me.TextBox3.ReadOnly = True
  52.         Me.TextBox3.Size = New System.Drawing.Size(320, 20)
  53.         Me.TextBox3.TabIndex = 7
  54.         Me.TextBox3.Text = ""
  55.         '
  56.         'TextBox1
  57.         '
  58.         Me.TextBox1.BackColor = System.Drawing.Color.White
  59.         Me.TextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
  60.         Me.TextBox1.Location = New System.Drawing.Point(8, 8)
  61.         Me.TextBox1.MaxLength = 1
  62.         Me.TextBox1.Name = "TextBox1"
  63.         Me.TextBox1.Size = New System.Drawing.Size(24, 20)
  64.         Me.TextBox1.TabIndex = 6
  65.         Me.TextBox1.Text = ""
  66.         Me.TextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  67.         '
  68.         'TextBox2
  69.         '
  70.         Me.TextBox2.BackColor = System.Drawing.Color.White
  71.         Me.TextBox2.Location = New System.Drawing.Point(8, 32)
  72.         Me.TextBox2.MaxLength = 1
  73.         Me.TextBox2.Multiline = True
  74.         Me.TextBox2.Name = "TextBox2"
  75.         Me.TextBox2.ReadOnly = True
  76.         Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
  77.         Me.TextBox2.Size = New System.Drawing.Size(352, 64)
  78.         Me.TextBox2.TabIndex = 8
  79.         Me.TextBox2.Text = ""
  80.         '
  81.         'baudot
  82.         '
  83.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  84.         Me.ClientSize = New System.Drawing.Size(366, 100)
  85.         Me.Controls.Add(Me.TextBox2)
  86.         Me.Controls.Add(Me.TextBox3)
  87.         Me.Controls.Add(Me.TextBox1)
  88.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
  89.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  90.         Me.MaximizeBox = False
  91.         Me.Name = "baudot"
  92.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  93.         Me.Text = "Baudot"
  94.         Me.ResumeLayout(False)
  95.  
  96.     End Sub
  97.  
  98. #End Region
  99.  
  100.     Private Sub Form8_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
  101.         Dim iniz As New iniz
  102.         iniz.Show()
  103.     End Sub
  104.  
  105.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  106.         If IsNumeric(TextBox1.Text) = True Then
  107.             controllo = True
  108.         Else
  109.             controllo = False
  110.         End If
  111.  
  112.         If a = 0 Then
  113.             If controllo = True Then TextBox2.Text = TextBox2.Text & "NUM"
  114.             If controllo = False Then TextBox2.Text = TextBox2.Text & "LTR"
  115.             a = 1
  116.         End If
  117.         If a = 1 Then
  118.             If IsNumeric(TextBox1.Text) = True Then
  119.                 controllo = True
  120.             End If
  121.  
  122.             If IsNumeric(TextBox1.Text) = False Then
  123.                 controllo = False
  124.             End If
  125.         End If
  126.  
  127.         Select Case TextBox1.Text
  128.             Case " "
  129.                 If a = 0 Then
  130.                     If controllo = True Then
  131.                         TextBox2.Text = TextBox2.Text & "NUM"
  132.                     End If
  133.                     If controllo = False Then
  134.                         TextBox2.Text = TextBox2.Text & "LTR"
  135.                     End If
  136.                 End If
  137.                 TextBox2.Text = TextBox2.Text & "00100"
  138.                 TextBox3.Text = TextBox3.Text & " "
  139.                 TextBox1.Clear()
  140.             Case "A"
  141.                 TextBox2.Text = TextBox2.Text & "00011"
  142.                 TextBox3.Text = TextBox3.Text & "A"
  143.                 TextBox1.Clear()
  144.                 If a <> 0 Then
  145.                     If controllo = True Then
  146.                         TextBox2.Text = TextBox2.Text & "LTR"
  147.                     End If
  148.                     If controllo = False Then
  149.                         TextBox2.Text = TextBox2.Text & "NUM"
  150.                     End If
  151.                 End If
  152.             Case "S"
  153.                 TextBox2.Text = TextBox2.Text & "01101"
  154.                 TextBox3.Text = TextBox3.Text & "S"
  155.                 TextBox1.Clear()
  156.                 If a <> 0 Then
  157.                     If controllo = True Then
  158.                         TextBox2.Text = TextBox2.Text & "LTR"
  159.                     End If
  160.                     If controllo = False Then
  161.                         TextBox2.Text = TextBox2.Text & "NUM"
  162.                     End If
  163.                 End If
  164.             Case "I"
  165.                 TextBox2.Text = TextBox2.Text & "00110"
  166.                 TextBox3.Text = TextBox3.Text & "I"
  167.                 TextBox1.Clear()
  168.                 If a <> 0 Then
  169.                     If controllo = True Then
  170.                         TextBox2.Text = TextBox2.Text & "LTR"
  171.                     End If
  172.                     If controllo = False Then
  173.                         TextBox2.Text = TextBox2.Text & "NUM"
  174.                     End If
  175.                 End If
  176.             Case "8"
  177.                 TextBox2.Text = TextBox2.Text & "00110"
  178.                 TextBox3.Text = TextBox3.Text & "8"
  179.                 TextBox1.Clear()
  180.                 If a <> 0 Then
  181.                     If controllo = True Then
  182.                         TextBox2.Text = TextBox2.Text & "LTR"
  183.                     End If
  184.                     If controllo = False Then
  185.                         TextBox2.Text = TextBox2.Text & "NUM"
  186.                     End If
  187.                 End If
  188.             Case "U"
  189.                 TextBox2.Text = TextBox2.Text & "00111"
  190.                 TextBox3.Text = TextBox3.Text & "U"
  191.                 TextBox1.Clear()
  192.             Case "7"
  193.                 If a <> 0 Then
  194.                     If controllo = True Then
  195.                         TextBox2.Text = TextBox2.Text & "LTR"
  196.                     End If
  197.                     If controllo = False Then
  198.                         TextBox2.Text = TextBox2.Text & "NUM"
  199.                     End If
  200.                 End If
  201.                 TextBox2.Text = TextBox2.Text & "00111"
  202.                 TextBox3.Text = TextBox3.Text & "7"
  203.                 TextBox1.Clear()
  204.             Case "D"
  205.                 TextBox2.Text = TextBox2.Text & "00110"
  206.                 TextBox3.Text = TextBox3.Text & "D"
  207.                 TextBox1.Clear()
  208.             Case "R"
  209.                 TextBox2.Text = TextBox2.Text & "01010"
  210.                 TextBox3.Text = TextBox3.Text & "R"
  211.                 TextBox1.Clear()
  212.             Case "4"
  213.                 TextBox2.Text = TextBox2.Text & "01010"
  214.                 TextBox3.Text = TextBox3.Text & "4"
  215.                 TextBox1.Clear()
  216.             Case "J"
  217.                 TextBox2.Text = TextBox2.Text & "01011"
  218.                 TextBox3.Text = TextBox3.Text & "J"
  219.                 TextBox1.Clear()
  220.             Case "N"
  221.                 TextBox2.Text = TextBox2.Text & "01100"
  222.                 TextBox3.Text = TextBox3.Text & "N"
  223.                 TextBox1.Clear()
  224.             Case "F"
  225.                 TextBox2.Text = TextBox2.Text & "01101"
  226.                 TextBox3.Text = TextBox3.Text & "F"
  227.                 TextBox1.Clear()
  228.             Case "C"
  229.                 TextBox2.Text = TextBox2.Text & "01010"
  230.                 TextBox3.Text = TextBox3.Text & "C"
  231.                 TextBox1.Clear()
  232.             Case "K"
  233.                 TextBox2.Text = TextBox2.Text & "01111"
  234.                 TextBox3.Text = TextBox3.Text & "K"
  235.                 TextBox1.Clear()
  236.             Case "L"
  237.                 TextBox2.Text = TextBox2.Text & "10010"
  238.                 TextBox3.Text = TextBox3.Text & "L"
  239.                 TextBox1.Clear()
  240.             Case "T"
  241.                 TextBox2.Text = TextBox2.Text & "10000"
  242.                 TextBox3.Text = TextBox3.Text & "T"
  243.                 TextBox1.Clear()
  244.             Case "5"
  245.                 TextBox2.Text = TextBox2.Text & "10000"
  246.                 TextBox3.Text = TextBox3.Text & "5"
  247.                 TextBox1.Clear()
  248.             Case "H"
  249.                 TextBox2.Text = TextBox2.Text & "10100"
  250.                 TextBox3.Text = TextBox3.Text & "H"
  251.                 TextBox1.Clear()
  252.             Case "Y"
  253.                 TextBox2.Text = TextBox2.Text & "10101"
  254.                 TextBox3.Text = TextBox3.Text & "Y"
  255.                 TextBox1.Clear()
  256.             Case "6"
  257.                 TextBox2.Text = TextBox2.Text & "10101"
  258.                 TextBox3.Text = TextBox3.Text & "6"
  259.                 TextBox1.Clear()
  260.             Case "Q"
  261.                 TextBox2.Text = TextBox2.Text & "10111"
  262.                 TextBox3.Text = TextBox3.Text & "Q"
  263.                 TextBox1.Clear()
  264.             Case "1"
  265.                 TextBox2.Text = TextBox2.Text & "10111"
  266.                 TextBox3.Text = TextBox3.Text & "1"
  267.                 TextBox1.Clear()
  268.             Case "P"
  269.                 TextBox2.Text = TextBox2.Text & "10110"
  270.                 TextBox3.Text = TextBox3.Text & "P"
  271.                 TextBox1.Clear()
  272.             Case "0"
  273.                 TextBox2.Text = TextBox2.Text & "10110"
  274.                 TextBox3.Text = TextBox3.Text & "0"
  275.                 TextBox1.Clear()
  276.             Case "O"
  277.                 TextBox2.Text = TextBox2.Text & "11000"
  278.                 TextBox3.Text = TextBox3.Text & "O"
  279.                 TextBox1.Clear()
  280.             Case "9"
  281.                 TextBox2.Text = TextBox2.Text & "11000"
  282.                 TextBox3.Text = TextBox3.Text & "9"
  283.                 TextBox1.Clear()
  284.             Case "B"
  285.                 TextBox2.Text = TextBox2.Text & "11001"
  286.                 TextBox3.Text = TextBox3.Text & "B"
  287.                 TextBox1.Clear()
  288.             Case "G"
  289.                 TextBox2.Text = TextBox2.Text & "11010"
  290.                 TextBox3.Text = TextBox3.Text & "G"
  291.                 TextBox1.Clear()
  292.             Case "M"
  293.                 TextBox2.Text = TextBox2.Text & "11100"
  294.                 TextBox3.Text = TextBox3.Text & "M"
  295.                 TextBox1.Clear()
  296.             Case "X"
  297.                 TextBox2.Text = TextBox2.Text & "11101"
  298.                 TextBox3.Text = TextBox3.Text & "X"
  299.                 TextBox1.Clear()
  300.             Case "V"
  301.                 TextBox2.Text = TextBox2.Text & "11110"
  302.                 TextBox3.Text = TextBox3.Text & "V"
  303.                 TextBox1.Clear()
  304.             Case "2"
  305.                 TextBox2.Text = TextBox2.Text & "10011"
  306.                 TextBox3.Text = TextBox3.Text & "2"
  307.                 TextBox1.Clear()
  308.             Case "E"
  309.                 TextBox2.Text = TextBox2.Text & "00001"
  310.                 TextBox3.Text = TextBox3.Text & "E"
  311.                 TextBox1.Clear()
  312.             Case "3"
  313.                 TextBox2.Text = TextBox2.Text & "00001"
  314.                 TextBox3.Text = TextBox3.Text & "3"
  315.                 TextBox1.Clear()
  316.             Case "W"
  317.                 TextBox2.Text = TextBox2.Text & "11001"
  318.                 TextBox3.Text = TextBox3.Text & "W"
  319.                 TextBox1.Clear()
  320.             Case "Z"
  321.                 TextBox2.Text = TextBox2.Text & "10001"
  322.                 TextBox3.Text = TextBox3.Text & "Z"
  323.                 TextBox1.Clear()
  324.         End Select
  325.     End Sub
  326.  
  327.     Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  328.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  329.     End Sub
  330.  
  331.     Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
  332.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  333.     End Sub
  334.  
  335.     Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
  336.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  337.     End Sub
  338. End Class