Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual Studio C # I made a calculator, and now I have to make a calculator memory (event). There are 4 components here: one Textbox

Visual Studio C #

I made a calculator, and now I have to make a calculator memory (event).

There are 4 components here: one Textbox for the answer, two Buttons - "M" and "M+", and one Lable to display the answer again.

When the user clicks the M button, the contents of the Answer TextBox should be copied to a memory variable. Also make it so that when the user moves the mouse over the label, the value in the memory variable will appear in this label, and then disappear, when the mouse moves away from the label. Also add one more button, an M+ button. When the user clicks this button, the contents of the Results box will be added to Memory. You will need to use a Global Variable to store this data.

Below is my code:

private String ans; private Double answer; private Double answerPlus;

private void btnM_Click(object sender, EventArgs e) { ans = txtDisplay.Text; answer = double.Parse(ans);

}

private void lblblank_MouseEnter(object sender, EventArgs e) { lblblank.Show(); lblblank.Text = answer.ToString(); }

private void lblblank_MouseLeave(object sender, EventArgs e) { lblblank.Hide(); }

private void btnMPlus_Click(object sender, EventArgs e) { answerPlus = answer + double.Parse(ans);

}

My problem is that the label doesn't appear when the mouse over the label, and also it doens't disappear when the mouse leave the label. How can I fix it?

And also, is this way the right way to use the Global variable?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions