create a windows application that contains 2 textbooks (with labels) and one but
ID: 3567571 • Letter: C
Question
create a windows application that contains 2 textbooks (with labels) and one button. the textbooks should be used to allow the user to input the x- and y- coordinates to indicate where the form should be positioned. When the user click the button, the window should be moved to that new point. Be sure to label the textboxes appropriately. Change the forms background color. Add a title caption to the form. Include a heading above the textboxes and button. Enlarge the size of the font. only allow positive integers to be used for the coordinates.
Explanation / Answer
public partial class calculation : Form
{
int scre1 , scre2 ,output ;
public calculation()
{
InitializeComponent();
}
private void show()
{
scre1 = 0; scre2 = 0;
int result = 0;
if (int.TryParse(textBox1.Text, out result))
scre1 = Convert.ToInt32(textBox1.Text);
if (int.TryParse(textBox2.Text, out result))
scre2 = Convert.ToInt32(textBox2.Text);
}
private void btnsum_Click(object sender, EventArgs e)
{
show();
output = scre1 + scre2 ;
lbloutput.Text = output.ToString();
lbloutput.Visible = true;
}
private void btnmul_Click(object sender, EventArgs e)
{
show();
output = scre1 * scre2;
lbloutput.Text = output.ToString();
lbloutput.Visible = true;
}
}
GUI INFO :) 2 LABLES (VALUE1 & VALUE 2 ) , 2 TEXT BOXES , 2 BUTTONS (BTNSUM,BTNMUL)
ONE LABLE (LBLOUTPUT) --> PROPERTY VISIBLE = FALSE
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.