Form1.cs
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
_0056 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
groupBox1.Select();
-
}
-
//Red
-
private
void
radioButtonRed_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 0, 0);
-
}
-
//Green
-
private
void
radioButtonGreen_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 255, 0);
-
}
-
//Blue
-
private
void
radioButtonBlue_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 0, 255);
-
}
-
//Reset
-
private
void
radioButtonReset_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 255, 255);
-
radioButtonRed.Checked =
false
;
-
radioButtonGreen.Checked =
false
;
-
radioButtonBlue.Checked =
false
;
-
radioButtonReset.Checked =
false
;
-
}
-
//кнопка равно
-
private
void
button1_Click(
object
sender, EventArgs e) {
-
uint
radio = 0;
-
if
(radioButtonOne.Checked) {
-
radio =
uint
.Parse(radioButtonOne.Text);
-
}
-
if
(radioButtonTwo.Checked) {
-
radio =
uint
.Parse(radioButtonTwo.Text);
-
}
-
if
(radioButtonThree.Checked) {
-
radio =
uint
.Parse(radioButtonThree.Text);
-
}
-
if
(textBox2.Text ==
string
.Empty) {
-
textBox3.Text = ((
int
)(0 + radio)).ToString();
-
}
-
else
{
-
textBox3.Text = ((
int
)(
int
.Parse(textBox2.Text) + radio)).ToString();
-
}
-
}
-
}
}
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
_0056 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
groupBox1.Select();
-
}
-
//Red
-
private
void
radioButtonRed_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 0, 0);
-
}
-
//Green
-
private
void
radioButtonGreen_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 255, 0);
-
}
-
//Blue
-
private
void
radioButtonBlue_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 0, 255);
-
}
-
//Reset
-
private
void
radioButtonReset_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 255, 255);
-
radioButtonRed.Checked =
false
;
-
radioButtonGreen.Checked =
false
;
-
radioButtonBlue.Checked =
false
;
-
radioButtonReset.Checked =
false
;
-
}
-
//кнопка равно
-
private
void
button1_Click(
object
sender, EventArgs e) {
-
uint
radio = 0;
-
if
(radioButtonOne.Checked) {
-
radio =
uint
.Parse(radioButtonOne.Text);
-
}
-
if
(radioButtonTwo.Checked) {
-
radio =
uint
.Parse(radioButtonTwo.Text);
-
}
-
if
(radioButtonThree.Checked) {
-
radio =
uint
.Parse(radioButtonThree.Text);
-
}
-
if
(textBox2.Text ==
string
.Empty) {
-
textBox3.Text = ((
int
)(0 + radio)).ToString();
-
}
-
else
{
-
textBox3.Text = ((
int
)(
int
.Parse(textBox2.Text) + radio)).ToString();
-
}
-
}
-
}
}