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

gray.vb

Caricato da:
Scarica il programma completo

  1. Public Class gray
  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 TextBox3 As System.Windows.Forms.TextBox
  33.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  34.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  35.     Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
  36.     Friend WithEvents Label1 As System.Windows.Forms.Label
  37.     Friend WithEvents Label2 As System.Windows.Forms.Label
  38.     Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
  39.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  40.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(gray))
  41.         Me.TextBox3 = New System.Windows.Forms.TextBox
  42.         Me.TextBox2 = New System.Windows.Forms.TextBox
  43.         Me.TextBox1 = New System.Windows.Forms.TextBox
  44.         Me.TextBox4 = New System.Windows.Forms.TextBox
  45.         Me.Label1 = New System.Windows.Forms.Label
  46.         Me.Label2 = New System.Windows.Forms.Label
  47.         Me.TextBox5 = New System.Windows.Forms.TextBox
  48.         Me.SuspendLayout()
  49.         '
  50.         'TextBox3
  51.         '
  52.         Me.TextBox3.BackColor = System.Drawing.Color.White
  53.         Me.TextBox3.Location = New System.Drawing.Point(8, 32)
  54.         Me.TextBox3.MaxLength = 1
  55.         Me.TextBox3.Multiline = True
  56.         Me.TextBox3.Name = "TextBox3"
  57.         Me.TextBox3.ReadOnly = True
  58.         Me.TextBox3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
  59.         Me.TextBox3.Size = New System.Drawing.Size(352, 64)
  60.         Me.TextBox3.TabIndex = 5
  61.         Me.TextBox3.Text = ""
  62.         '
  63.         'TextBox2
  64.         '
  65.         Me.TextBox2.BackColor = System.Drawing.Color.White
  66.         Me.TextBox2.Location = New System.Drawing.Point(40, 8)
  67.         Me.TextBox2.MaxLength = 1
  68.         Me.TextBox2.Name = "TextBox2"
  69.         Me.TextBox2.ReadOnly = True
  70.         Me.TextBox2.Size = New System.Drawing.Size(320, 20)
  71.         Me.TextBox2.TabIndex = 4
  72.         Me.TextBox2.Text = ""
  73.         '
  74.         'TextBox1
  75.         '
  76.         Me.TextBox1.BackColor = System.Drawing.Color.White
  77.         Me.TextBox1.Location = New System.Drawing.Point(8, 8)
  78.         Me.TextBox1.MaxLength = 1
  79.         Me.TextBox1.Name = "TextBox1"
  80.         Me.TextBox1.Size = New System.Drawing.Size(24, 20)
  81.         Me.TextBox1.TabIndex = 3
  82.         Me.TextBox1.Text = ""
  83.         Me.TextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  84.         '
  85.         'TextBox4
  86.         '
  87.         Me.TextBox4.BackColor = System.Drawing.Color.White
  88.         Me.TextBox4.Location = New System.Drawing.Point(80, 118)
  89.         Me.TextBox4.MaxLength = 1
  90.         Me.TextBox4.Name = "TextBox4"
  91.         Me.TextBox4.ReadOnly = True
  92.         Me.TextBox4.Size = New System.Drawing.Size(29, 20)
  93.         Me.TextBox4.TabIndex = 6
  94.         Me.TextBox4.Text = ""
  95.         Me.TextBox4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
  96.         '
  97.         'Label1
  98.         '
  99.         Me.Label1.Location = New System.Drawing.Point(8, 120)
  100.         Me.Label1.Name = "Label1"
  101.         Me.Label1.Size = New System.Drawing.Size(72, 16)
  102.         Me.Label1.TabIndex = 7
  103.         Me.Label1.Text = "Speculare a :"
  104.         '
  105.         'Label2
  106.         '
  107.         Me.Label2.Location = New System.Drawing.Point(112, 120)
  108.         Me.Label2.Name = "Label2"
  109.         Me.Label2.Size = New System.Drawing.Size(16, 16)
  110.         Me.Label2.TabIndex = 8
  111.         Me.Label2.Text = "="
  112.         '
  113.         'TextBox5
  114.         '
  115.         Me.TextBox5.BackColor = System.Drawing.Color.White
  116.         Me.TextBox5.Location = New System.Drawing.Point(128, 104)
  117.         Me.TextBox5.MaxLength = 1
  118.         Me.TextBox5.Multiline = True
  119.         Me.TextBox5.Name = "TextBox5"
  120.         Me.TextBox5.ReadOnly = True
  121.         Me.TextBox5.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
  122.         Me.TextBox5.Size = New System.Drawing.Size(232, 48)
  123.         Me.TextBox5.TabIndex = 9
  124.         Me.TextBox5.Text = ""
  125.         '
  126.         'gray
  127.         '
  128.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  129.         Me.ClientSize = New System.Drawing.Size(366, 156)
  130.         Me.Controls.Add(Me.TextBox5)
  131.         Me.Controls.Add(Me.Label2)
  132.         Me.Controls.Add(Me.Label1)
  133.         Me.Controls.Add(Me.TextBox4)
  134.         Me.Controls.Add(Me.TextBox3)
  135.         Me.Controls.Add(Me.TextBox2)
  136.         Me.Controls.Add(Me.TextBox1)
  137.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
  138.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  139.         Me.MaximizeBox = False
  140.         Me.Name = "gray"
  141.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  142.         Me.Text = "Gray"
  143.         Me.ResumeLayout(False)
  144.  
  145.     End Sub
  146.  
  147. #End Region
  148.  
  149.     Private Sub Form5_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
  150.         Dim iniz As New iniz
  151.         iniz.Show()
  152.     End Sub
  153.  
  154.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
  155.         Select Case TextBox1.Text
  156.             Case "0"
  157.                 TextBox2.Text = TextBox2.Text & "0"
  158.                 TextBox3.Text = TextBox3.Text & "0000"
  159.                 TextBox4.Text = "15"
  160.                 TextBox5.Text = TextBox5.Text & "1000"
  161.                 TextBox1.SelectAll()
  162.             Case "1"
  163.                 TextBox2.Text = TextBox2.Text & "1"
  164.                 TextBox3.Text = TextBox3.Text & "0001"
  165.                 TextBox4.Text = "14"
  166.                 TextBox5.Text = TextBox5.Text & "1001"
  167.                 TextBox1.SelectAll()
  168.             Case "2"
  169.                 TextBox2.Text = TextBox2.Text & "2"
  170.                 TextBox3.Text = TextBox3.Text & "0011"
  171.                 TextBox4.Text = "13"
  172.                 TextBox5.Text = TextBox5.Text & "1011"
  173.                 TextBox1.SelectAll()
  174.  
  175.             Case "3"
  176.                 TextBox2.Text = TextBox2.Text & "3"
  177.                 TextBox3.Text = TextBox3.Text & "0010"
  178.                 TextBox4.Text = "12"
  179.                 TextBox5.Text = TextBox5.Text & "1010"
  180.                 TextBox1.SelectAll()
  181.             Case "4"
  182.                 TextBox2.Text = TextBox2.Text & "4"
  183.                 TextBox3.Text = TextBox3.Text & "0110"
  184.                 TextBox4.Text = "11"
  185.                 TextBox5.Text = TextBox5.Text & "1110"
  186.                 TextBox1.SelectAll()
  187.             Case "5"
  188.                 TextBox2.Text = TextBox2.Text & "5"
  189.                 TextBox3.Text = TextBox3.Text & "0111"
  190.                 TextBox4.Text = "10"
  191.                 TextBox5.Text = TextBox5.Text & "1111"
  192.                 TextBox1.SelectAll()
  193.             Case "6"
  194.                 TextBox2.Text = TextBox2.Text & "6"
  195.                 TextBox3.Text = TextBox3.Text & "0101"
  196.                 TextBox1.SelectAll()
  197.                 TextBox5.Text = TextBox5.Text & "1101"
  198.                 TextBox4.Text = "9"
  199.             Case "7"
  200.                 TextBox2.Text = TextBox2.Text & "7"
  201.                 TextBox3.Text = TextBox3.Text & "0100"
  202.                 TextBox4.Text = "8"
  203.                 TextBox5.Text = TextBox5.Text & "1100"
  204.                 TextBox1.SelectAll()
  205.             Case Else
  206.                 MsgBox("Immettere solo valori numerici da 0 a 7", MsgBoxStyle.Critical, Me.Text)
  207.         End Select
  208.     End Sub
  209.  
  210.     Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  211.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  212.     End Sub
  213.  
  214.     Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
  215.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  216.     End Sub
  217.  
  218.     Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
  219.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  220.     End Sub
  221.  
  222.     Private Sub TextBox4_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox4.KeyPress
  223.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  224.     End Sub
  225.  
  226.     Private Sub TextBox5_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox5.KeyPress
  227.         If e.KeyChar = Microsoft.VisualBasic.ChrW(27) = True Then Me.Close()
  228.     End Sub
  229. End Class