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
Morra Cinese - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Public Class Form1
  2.     Inherits System.Windows.Forms.Form
  3.  
  4. #Region " Windows Form Designer generated code "
  5.  
  6.     Public Sub New()
  7.         MyBase.New()
  8.  
  9.         'This call is required by the Windows Form Designer.
  10.         InitializeComponent()
  11.  
  12.         'Add any initialization after the InitializeComponent() call
  13.  
  14.     End Sub
  15.  
  16.     'Form overrides dispose to clean up the component list.
  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.     'Required by the Windows Form Designer
  27.     Private components As System.ComponentModel.IContainer
  28.  
  29.     'NOTE: The following procedure is required by the Windows Form Designer
  30.     'It can be modified using the Windows Form Designer.  
  31.     'Do not modify it using the code editor.
  32.     Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
  33.     Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
  34.     Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
  35.     Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox
  36.     Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox
  37.     Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
  38.     Friend WithEvents Label1 As System.Windows.Forms.Label
  39.     Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  40.     Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
  41.     Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
  42.     Friend WithEvents Label2 As System.Windows.Forms.Label
  43.     Friend WithEvents Label3 As System.Windows.Forms.Label
  44.     Friend WithEvents o1 As System.Windows.Forms.RadioButton
  45.     Friend WithEvents o2 As System.Windows.Forms.RadioButton
  46.     Friend WithEvents o3 As System.Windows.Forms.RadioButton
  47.     Friend WithEvents PictureBox6 As System.Windows.Forms.PictureBox
  48.     Friend WithEvents Label4 As System.Windows.Forms.Label
  49.     Friend WithEvents Label5 As System.Windows.Forms.Label
  50.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  51.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  52.         Me.PictureBox1 = New System.Windows.Forms.PictureBox
  53.         Me.PictureBox2 = New System.Windows.Forms.PictureBox
  54.         Me.PictureBox3 = New System.Windows.Forms.PictureBox
  55.         Me.PictureBox4 = New System.Windows.Forms.PictureBox
  56.         Me.PictureBox5 = New System.Windows.Forms.PictureBox
  57.         Me.o1 = New System.Windows.Forms.RadioButton
  58.         Me.o2 = New System.Windows.Forms.RadioButton
  59.         Me.o3 = New System.Windows.Forms.RadioButton
  60.         Me.TextBox1 = New System.Windows.Forms.TextBox
  61.         Me.Label1 = New System.Windows.Forms.Label
  62.         Me.GroupBox1 = New System.Windows.Forms.GroupBox
  63.         Me.Label3 = New System.Windows.Forms.Label
  64.         Me.Label2 = New System.Windows.Forms.Label
  65.         Me.TextBox3 = New System.Windows.Forms.TextBox
  66.         Me.TextBox2 = New System.Windows.Forms.TextBox
  67.         Me.PictureBox6 = New System.Windows.Forms.PictureBox
  68.         Me.Label4 = New System.Windows.Forms.Label
  69.         Me.Label5 = New System.Windows.Forms.Label
  70.         Me.GroupBox1.SuspendLayout()
  71.         Me.SuspendLayout()
  72.         '
  73.         'PictureBox1
  74.         '
  75.         Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
  76.         Me.PictureBox1.Location = New System.Drawing.Point(56, 40)
  77.         Me.PictureBox1.Name = "PictureBox1"
  78.         Me.PictureBox1.Size = New System.Drawing.Size(152, 192)
  79.         Me.PictureBox1.TabIndex = 0
  80.         Me.PictureBox1.TabStop = False
  81.         '
  82.         'PictureBox2
  83.         '
  84.         Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
  85.         Me.PictureBox2.Location = New System.Drawing.Point(72, 232)
  86.         Me.PictureBox2.Name = "PictureBox2"
  87.         Me.PictureBox2.Size = New System.Drawing.Size(176, 136)
  88.         Me.PictureBox2.TabIndex = 1
  89.         Me.PictureBox2.TabStop = False
  90.         '
  91.         'PictureBox3
  92.         '
  93.         Me.PictureBox3.Image = CType(resources.GetObject("PictureBox3.Image"), System.Drawing.Image)
  94.         Me.PictureBox3.Location = New System.Drawing.Point(48, 376)
  95.         Me.PictureBox3.Name = "PictureBox3"
  96.         Me.PictureBox3.Size = New System.Drawing.Size(192, 128)
  97.         Me.PictureBox3.TabIndex = 2
  98.         Me.PictureBox3.TabStop = False
  99.         '
  100.         'PictureBox4
  101.         '
  102.         Me.PictureBox4.Image = CType(resources.GetObject("PictureBox4.Image"), System.Drawing.Image)
  103.         Me.PictureBox4.Location = New System.Drawing.Point(184, 8)
  104.         Me.PictureBox4.Name = "PictureBox4"
  105.         Me.PictureBox4.Size = New System.Drawing.Size(280, 56)
  106.         Me.PictureBox4.TabIndex = 3
  107.         Me.PictureBox4.TabStop = False
  108.         '
  109.         'PictureBox5
  110.         '
  111.         Me.PictureBox5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
  112.         Me.PictureBox5.Image = CType(resources.GetObject("PictureBox5.Image"), System.Drawing.Image)
  113.         Me.PictureBox5.Location = New System.Drawing.Point(256, 384)
  114.         Me.PictureBox5.Name = "PictureBox5"
  115.         Me.PictureBox5.Size = New System.Drawing.Size(176, 80)
  116.         Me.PictureBox5.TabIndex = 4
  117.         Me.PictureBox5.TabStop = False
  118.         '
  119.         'o1
  120.         '
  121.         Me.o1.BackColor = System.Drawing.SystemColors.ControlText
  122.         Me.o1.Location = New System.Drawing.Point(16, 112)
  123.         Me.o1.Name = "o1"
  124.         Me.o1.Size = New System.Drawing.Size(16, 24)
  125.         Me.o1.TabIndex = 5
  126.         '
  127.         'o2
  128.         '
  129.         Me.o2.BackColor = System.Drawing.SystemColors.ControlText
  130.         Me.o2.Location = New System.Drawing.Point(16, 272)
  131.         Me.o2.Name = "o2"
  132.         Me.o2.Size = New System.Drawing.Size(16, 24)
  133.         Me.o2.TabIndex = 6
  134.         '
  135.         'o3
  136.         '
  137.         Me.o3.BackColor = System.Drawing.SystemColors.ControlText
  138.         Me.o3.Location = New System.Drawing.Point(16, 424)
  139.         Me.o3.Name = "o3"
  140.         Me.o3.Size = New System.Drawing.Size(16, 24)
  141.         Me.o3.TabIndex = 7
  142.         '
  143.         'TextBox1
  144.         '
  145.         Me.TextBox1.Enabled = False
  146.         Me.TextBox1.Font = New System.Drawing.Font("Tw Cen MT", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  147.         Me.TextBox1.Location = New System.Drawing.Point(368, 144)
  148.         Me.TextBox1.Name = "TextBox1"
  149.         Me.TextBox1.Size = New System.Drawing.Size(120, 25)
  150.         Me.TextBox1.TabIndex = 8
  151.         Me.TextBox1.Text = ""
  152.         '
  153.         'Label1
  154.         '
  155.         Me.Label1.Font = New System.Drawing.Font("Comic Sans MS", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  156.         Me.Label1.ForeColor = System.Drawing.SystemColors.ActiveCaption
  157.         Me.Label1.Location = New System.Drawing.Point(368, 104)
  158.         Me.Label1.Name = "Label1"
  159.         Me.Label1.Size = New System.Drawing.Size(192, 32)
  160.         Me.Label1.TabIndex = 9
  161.         Me.Label1.Text = "Scelta Computer"
  162.         '
  163.         'GroupBox1
  164.         '
  165.         Me.GroupBox1.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(255, Byte), CType(255, Byte))
  166.         Me.GroupBox1.Controls.Add(Me.Label3)
  167.         Me.GroupBox1.Controls.Add(Me.Label2)
  168.         Me.GroupBox1.Controls.Add(Me.TextBox3)
  169.         Me.GroupBox1.Controls.Add(Me.TextBox2)
  170.         Me.GroupBox1.Font = New System.Drawing.Font("Comic Sans MS", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  171.         Me.GroupBox1.Location = New System.Drawing.Point(360, 208)
  172.         Me.GroupBox1.Name = "GroupBox1"
  173.         Me.GroupBox1.Size = New System.Drawing.Size(200, 112)
  174.         Me.GroupBox1.TabIndex = 10
  175.         Me.GroupBox1.TabStop = False
  176.         Me.GroupBox1.Text = "PUTENGGI"
  177.         '
  178.         'Label3
  179.         '
  180.         Me.Label3.Font = New System.Drawing.Font("Comic Sans MS", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  181.         Me.Label3.ForeColor = System.Drawing.Color.Red
  182.         Me.Label3.Location = New System.Drawing.Point(80, 40)
  183.         Me.Label3.Name = "Label3"
  184.         Me.Label3.Size = New System.Drawing.Size(128, 32)
  185.         Me.Label3.TabIndex = 11
  186.         Me.Label3.Text = "Computer"
  187.         '
  188.         'Label2
  189.         '
  190.         Me.Label2.Font = New System.Drawing.Font("Comic Sans MS", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  191.         Me.Label2.ForeColor = System.Drawing.Color.Red
  192.         Me.Label2.Location = New System.Drawing.Point(16, 40)
  193.         Me.Label2.Name = "Label2"
  194.         Me.Label2.Size = New System.Drawing.Size(52, 32)
  195.         Me.Label2.TabIndex = 10
  196.         Me.Label2.Text = "Tuo"
  197.         '
  198.         'TextBox3
  199.         '
  200.         Me.TextBox3.Enabled = False
  201.         Me.TextBox3.Location = New System.Drawing.Point(104, 72)
  202.         Me.TextBox3.Name = "TextBox3"
  203.         Me.TextBox3.Size = New System.Drawing.Size(64, 34)
  204.         Me.TextBox3.TabIndex = 1
  205.         Me.TextBox3.Text = ""
  206.         '
  207.         'TextBox2
  208.         '
  209.         Me.TextBox2.Enabled = False
  210.         Me.TextBox2.Location = New System.Drawing.Point(16, 72)
  211.         Me.TextBox2.Name = "TextBox2"
  212.         Me.TextBox2.Size = New System.Drawing.Size(64, 34)
  213.         Me.TextBox2.TabIndex = 0
  214.         Me.TextBox2.Text = ""
  215.         '
  216.         'PictureBox6
  217.         '
  218.         Me.PictureBox6.Image = CType(resources.GetObject("PictureBox6.Image"), System.Drawing.Image)
  219.         Me.PictureBox6.Location = New System.Drawing.Point(456, 384)
  220.         Me.PictureBox6.Name = "PictureBox6"
  221.         Me.PictureBox6.Size = New System.Drawing.Size(168, 80)
  222.         Me.PictureBox6.TabIndex = 11
  223.         Me.PictureBox6.TabStop = False
  224.         '
  225.         'Label4
  226.         '
  227.         Me.Label4.Font = New System.Drawing.Font("Verdana", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  228.         Me.Label4.Location = New System.Drawing.Point(496, 376)
  229.         Me.Label4.Name = "Label4"
  230.         Me.Label4.Size = New System.Drawing.Size(168, 24)
  231.         Me.Label4.TabIndex = 12
  232.         Me.Label4.Text = "Reset"
  233.         '
  234.         'Label5
  235.         '
  236.         Me.Label5.Font = New System.Drawing.Font("Arial Rounded MT Bold", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
  237.         Me.Label5.ForeColor = System.Drawing.Color.Gold
  238.         Me.Label5.Location = New System.Drawing.Point(296, 496)
  239.         Me.Label5.Name = "Label5"
  240.         Me.Label5.Size = New System.Drawing.Size(328, 32)
  241.         Me.Label5.TabIndex = 13
  242.         Me.Label5.Text = "By  «•K®‡S']['売ºº5•»™"
  243.         '
  244.         'Form1
  245.         '
  246.         Me.AutoScaleBaseSize = New System.Drawing.Size(6, 13)
  247.         Me.BackColor = System.Drawing.SystemColors.ActiveCaptionText
  248.         Me.ClientSize = New System.Drawing.Size(648, 542)
  249.         Me.Controls.Add(Me.Label5)
  250.         Me.Controls.Add(Me.Label4)
  251.         Me.Controls.Add(Me.PictureBox6)
  252.         Me.Controls.Add(Me.GroupBox1)
  253.         Me.Controls.Add(Me.Label1)
  254.         Me.Controls.Add(Me.TextBox1)
  255.         Me.Controls.Add(Me.o3)
  256.         Me.Controls.Add(Me.o2)
  257.         Me.Controls.Add(Me.o1)
  258.         Me.Controls.Add(Me.PictureBox5)
  259.         Me.Controls.Add(Me.PictureBox4)
  260.         Me.Controls.Add(Me.PictureBox3)
  261.         Me.Controls.Add(Me.PictureBox2)
  262.         Me.Controls.Add(Me.PictureBox1)
  263.         Me.Font = New System.Drawing.Font("SimSun", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
  264.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  265.         Me.Name = "Form1"
  266.         Me.Text = "MORRA CINESE    By «•K®‡S']['売ºº5•»™"
  267.         Me.GroupBox1.ResumeLayout(False)
  268.         Me.ResumeLayout(False)
  269.  
  270.     End Sub
  271.  
  272. #End Region
  273.  
  274.     ' Code Scritto Da Krystal
  275.  
  276.     Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
  277.  
  278.     End Sub
  279.  
  280.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  281.  
  282.     End Sub
  283.  
  284.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  285.         Randomize()
  286.  
  287.     End Sub
  288.  
  289.     Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox5.Click
  290.         Dim a As Integer
  291.         Dim carta, forbice, sasso As String
  292.         a = (Rnd() * 2)
  293.         TextBox1.Text = a
  294.         Select Case TextBox1.Text
  295.             Case 0
  296.                 TextBox1.Text = "Carta"
  297.             Case 1
  298.                 TextBox1.Text = "Forbice"
  299.             Case 2
  300.                 TextBox1.Text = "Sasso"
  301.         End Select
  302.         ' Caso della carta
  303.         If o1.Checked = True And TextBox1.Text = "Sasso" Then
  304.             MsgBox(" Complimenti hai vinto! ")
  305.             TextBox2.Text = Val(TextBox2.Text) + 1
  306.         ElseIf o1.Checked And TextBox1.Text = "Carta" Then
  307.             MsgBox("Avete Pareggiato!!")
  308.         ElseIf o1.Checked And TextBox1.Text = "Forbice" Then
  309.             MsgBox("Ha vinto il computer!")
  310.             TextBox3.Text = Val(TextBox3.Text) + 1
  311.             ' Caso della forbice
  312.         ElseIf o2.Checked = True And TextBox1.Text = "Sasso" Then
  313.             MsgBox("Ha vinto il computer!")
  314.             TextBox3.Text = Val(TextBox3.Text) + 1
  315.         ElseIf o2.Checked And TextBox1.Text = "Carta" Then
  316.             MsgBox(" Complimenti hai vinto! ")
  317.             TextBox2.Text = Val(TextBox2.Text) + 1
  318.         ElseIf o2.Checked And TextBox1.Text = "Forbice" Then
  319.             MsgBox("Avete Pareggiato!!")
  320.             'Caso Dela sasso
  321.         ElseIf o3.Checked = True And TextBox1.Text = "Sasso" Then
  322.             MsgBox("Avete Pareggiato!!")
  323.  
  324.         ElseIf o3.Checked And TextBox1.Text = "Carta" Then
  325.             MsgBox("Ha vinto il computer!")
  326.             TextBox3.Text = Val(TextBox3.Text) + 1
  327.         ElseIf o3.Checked And TextBox1.Text = "Forbice" Then
  328.             MsgBox(" Complimenti hai vinto! ")
  329.             TextBox2.Text = Val(TextBox2.Text) + 1
  330.  
  331.  
  332.         End If
  333.         If o1.Checked = False And o2.Checked = False And o3.Checked = False Then
  334.             MsgBox(" Devi fare la tua scelta!")
  335.         End If
  336.  
  337.     End Sub
  338.  
  339.  
  340.  
  341.     Private Sub PictureBox6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox6.Click
  342.         Dim a
  343.         TextBox1.Text = ""
  344.         TextBox2.Text = ""
  345.         TextBox3.Text = ""
  346.         o1.Checked = False
  347.         o2.Checked = False
  348.         o3.Checked = False
  349.         a = ""
  350.  
  351.  
  352.     End Sub
  353. End Class