Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace TwoFriendsInteractiveGUI
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void btnCompare_Click(object sender, EventArgs e)
- {
- string friend1, friend2;
- btnCompare.Font = btnCompare.Font = new Font(btnCompare.Font.Name, 12, btnCompare.Font.Style, btnCompare.Font.Unit);
- friend1 = Convert.ToString(txtFriend1.Text);
- friend2 = Convert.ToString(txtFriend2.Text);
- int compareStrings = String.Compare(friend1, friend2);
- if (compareStrings == 0)
- {
- btnCompare.Text = "The names are the same";
- }
- else
- {
- btnCompare.Text = "The names are not the same";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement