Advertisement
_blackdog

Visual Basic "Test-Programm"

Feb 20th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. Public Class Form1
  2.     Dim Server1, Server2, User As Double
  3.  
  4.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  5.  
  6.     End Sub
  7.  
  8.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  9.         Server1 = TextBox1.Text
  10.         Server2 = TextBox2.Text
  11.         If TextBox1.Text < TextBox2.Text Then
  12.             TextBox1.Text = "01" + Server1
  13.             TextBox3.Text = "Connected to Server1"
  14.         End If
  15.  
  16.         If TextBox2.Text < TextBox1.Text Then
  17.             TextBox2.Text = "01" + Server2
  18.             TextBox3.Text = "Connected to Server2"
  19.  
  20.         ElseIf TextBox1.Text = TextBox2.Text Then
  21.             TextBox1.Text = "01" + Server1
  22.             TextBox3.Text = "Connected to Server1"
  23.         End If
  24.     End Sub
  25.  
  26.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  27.  
  28.         If TextBox3.Text = " " Then
  29.             MessageBox.Show("You aren't connect to a server!", "Error", MessageBoxButtons.OK)
  30.  
  31.         ElseIf TextBox3.Text = "Connected to Server1" Then
  32.             TextBox1.Text = Server1 - "01"
  33.             TextBox3.Text = " "
  34.         End If
  35.  
  36.         If TextBox3.Text = "Connected to Server2" Then
  37.             TextBox2.Text = Server2 - "01"
  38.             TextBox3.Text = " "
  39.         End If
  40.     End Sub
  41. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement