Answer on Question#39541- Programming, C#
1. What are all the other names for the word "modules" in context with C++ programming?
Solution.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Translate_button1_Click(object sender, EventArgs e)
{
double usd;
double k;
double rub;
usd = Convert.ToDouble(Currency_textBox1.Text);
k = Convert.ToDouble(Amount_textBox2.Text);
rub = usd * k;
Result_textBox3.Text = rub.ToString("C");
}
private void Currency_textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar >= '0') && (e.KeyChar <= '9'))
return;
if (e.KeyChar == '.')
e.KeyChar = ',';
if (e.KeyChar == ',')
{
if ((Currency_textBox1.Text.IndexOf(',') != -1) ||
(Currency_textBox1.Text.Length == 0))
{
e.Handled = true;
}
return;
}
if (Char.IsControl(e.KeyChar))
{
if (e.KeyChar == (char)Keys.Enter)
{
if (sender.Equals(Currency_textBox1))
Amount_textBox2.Focus();
else
Translate_button1.Focus();
}
}
e.Handled = true;
}
private void Currency_textBox1_TextChanged(object sender, EventArgs e)
{
Result_textBox3.Text = "";
}
}
}
Comments