Write a C# Windows Forms App code in Visual studio with a "start", "stop", "up", "down", "left" and "right" buttons and a textbox.
The textbox should start printing numbers from 1 to 100 on the press of the "start" button and stop printing process immediately on the press of "stop" button.
Also create a thread after stop button is pressed to allow manual input from "up", "down", "left" and "right" buttons and print up, down, left or right in the same textbox.
//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;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PrintNumbers
{
public partial class Form1 : Form
{
static bool stop = false;
BackgroundWorker bgw;
String numbers = "";
public Form1()
{
InitializeComponent();
bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(bgw_DoWork);
bgw.ProgressChanged += new
ProgressChangedEventHandler(bgw_ProgressChanged);
bgw.WorkerReportsProgress = true;
bgw.WorkerSupportsCancellation = true;
}
private void bgw_DoWork(object sender, DoWorkEventArgs e)
{
stop = false;
PrintNumbers();
}
private void bgw_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
btnDown.Enabled = false;
btnLeft.Enabled = false;
btnRight.Enabled = false;
btnUp.Enabled = false;
NumTextbox.Refresh();
NumTextbox.Text = numbers;
}
public void PrintNumbers()
{
int i = 1;
while(!stop)
{
numbers = numbers + (i).ToString();
bgw.ReportProgress(0);
Thread.Sleep(500);
i++;
}
}
private void StopClk(object sender, EventArgs e)
{
stop = true;
btnDown.Enabled = true;
btnLeft.Enabled = true;
btnRight.Enabled = true;
btnUp.Enabled = true;
bgw.CancelAsync();
}
private void StartClk(object sender, EventArgs e)
{
bgw.RunWorkerAsync(); //call backgroundworker to handle task on click of start
}
private void btnUp_Click(object sender, EventArgs e)
{
NumTextbox.Text = btnUp.Text;
}
private void btnRight_Click(object sender, EventArgs e)
{
NumTextbox.Text = btnRight.Text;
}
private void btnLeft_Click(object sender, EventArgs e)
{
NumTextbox.Text = btnLeft.Text;
}
private void btnDown_Click(object sender, EventArgs e)
{
NumTextbox.Text = btnDown.Text;
}
}
}
//form1.designer.cs
namespace PrintNumbers
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.NumTextbox = new System.Windows.Forms.TextBox();
this.btnStart = new System.Windows.Forms.Button();
this.btnRight = new System.Windows.Forms.Button();
this.btnLeft = new System.Windows.Forms.Button();
this.btnDown = new System.Windows.Forms.Button();
this.btnUp = new System.Windows.Forms.Button();
this.btnStop = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// NumTextbox
//
this.NumTextbox.Location = new System.Drawing.Point(12, 12);
this.NumTextbox.Multiline = true;
this.NumTextbox.Name = "NumTextbox";
this.NumTextbox.Size = new System.Drawing.Size(260, 83);
this.NumTextbox.TabIndex = 0;
//
// btnStart
//
this.btnStart.Location = new System.Drawing.Point(36, 207);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(75, 23);
this.btnStart.TabIndex = 1;
this.btnStart.Text = "START";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new
System.EventHandler(this.StartClk);
//
// btnRight
//
this.btnRight.Enabled = false;
this.btnRight.Location = new System.Drawing.Point(186, 138);
this.btnRight.Name = "btnRight";
this.btnRight.Size = new System.Drawing.Size(75, 23);
this.btnRight.TabIndex = 2;
this.btnRight.Text = "RIGHT";
this.btnRight.UseVisualStyleBackColor = true;
this.btnRight.Click += new
System.EventHandler(this.btnRight_Click);
//
// btnLeft
//
this.btnLeft.Enabled = false;
this.btnLeft.Location = new System.Drawing.Point(24, 138);
this.btnLeft.Name = "btnLeft";
this.btnLeft.Size = new System.Drawing.Size(75, 23);
this.btnLeft.TabIndex = 3;
this.btnLeft.Text = "LEFT";
this.btnLeft.UseVisualStyleBackColor = true;
this.btnLeft.Click += new
System.EventHandler(this.btnLeft_Click);
//
// btnDown
//
this.btnDown.Enabled = false;
this.btnDown.Location = new System.Drawing.Point(105, 167);
this.btnDown.Name = "btnDown";
this.btnDown.Size = new System.Drawing.Size(75, 23);
this.btnDown.TabIndex = 4;
this.btnDown.Text = "DOWN";
this.btnDown.UseVisualStyleBackColor = true;
this.btnDown.Click += new
System.EventHandler(this.btnDown_Click);
//
// btnUp
//
this.btnUp.Enabled = false;
this.btnUp.Location = new System.Drawing.Point(105, 120);
this.btnUp.Name = "btnUp";
this.btnUp.Size = new System.Drawing.Size(75, 23);
this.btnUp.TabIndex = 5;
this.btnUp.Text = "UP";
this.btnUp.UseVisualStyleBackColor = true;
this.btnUp.Click += new
System.EventHandler(this.btnUp_Click);
//
// btnStop
//
this.btnStop.Location = new System.Drawing.Point(175, 207);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(75, 23);
this.btnStop.TabIndex = 6;
this.btnStop.Text = "STOP";
this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.StopClk);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 262);
this.Controls.Add(this.btnStop);
this.Controls.Add(this.btnUp);
this.Controls.Add(this.btnDown);
this.Controls.Add(this.btnLeft);
this.Controls.Add(this.btnRight);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.NumTextbox);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox NumTextbox;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Button btnRight;
private System.Windows.Forms.Button btnLeft;
private System.Windows.Forms.Button btnDown;
private System.Windows.Forms.Button btnUp;
private System.Windows.Forms.Button btnStop;
}
}

Write a C# Windows Forms App code in Visual studio with a "start", "stop", "up", "down",...
Please note: This is in Visual Basic. Create an application (windows forms app). Add a label and a button to the form. The button’s Click event procedure should declare and initialize a one-dimensional Double array. Use any six numbers to initialize the array. The procedure should display (in the label) the lowest value stored in the array. Code the procedure using the For...Next statement.
Please code the following Java App using
Swing
No additional classes are required. With that in mind ...
Write a program that emulates a calculator. Create a Label with
a title of "Super Calculator", a textbox, where the numbers are
displayed, a series of buttons labeled as shown, and a “Clear”
button.
As the user enters the numbers, pressing the number buttons,
display the numbers right justified to the textbox. When the user
press any one of the operators, +,...
Programming question. Using Visual Studio 2019 C#. Windows Forms Application. Write the code that assigns the number 15 to the reward variable when the state variable contains the string “IL” (entered using any case) and the sales variable contains a number that is greater than 2000; otherwise, assign the number 5.
PLEASE USE VISUAL BASIC* BY VISUAL STUDIO.
Visual Basic INTERMEDIATE Create a Windows Forms application. Use the following names for the project and solution, respectively: Chopkins Project and Chopkins Solution. Save the application in the VB2017\Chap03 folder. Change the form file's name to Main Form.vb. Change the form's name to frmMain. Create the interface shown in Figure 3-37. The interface contains six labels, three text boxes, and two buttons. The application calculates and displays the total number of packs ordered...
Create a C# program using WINDOWS FORM App in Visual Studio. THE ANSWER MUST BE IN C#, IN WINDOW FORM APP, IN VISUAL STUDIOS. Write the code to: Write a method called MaximumDiffrence that accepts an integer array as a parameter and return the maximum difference between adjacent values in the array, where the gap is defined as the absolute value of the difference between the 2 adjacent values. Example: if the array contains {5, 7, 4, 9, 6, 12,...
VISUAL STUDIO - WINDOWS FORM APP (C#) - PLEASE MAKE SURE
TO SHOW ALL CODE & ANSWER/FOLLOW ALL THE QUESTIONS IN THE
ASSIGNMENT!
. . Your program assignment Write a program name DeskGUI that computes the price of a desk and whose button Click Event calls the following methods: • A method to accept the number of drawers in the desk as input from the key board. This method returns the number of drawers to the SelectDesk_Click event. A method...
VISUAL STUDIO - WINDOWS FORM APP (C#) - PLEASE MAKE SURE
TO SHOW ALL CODE & ANSWER/FOLLOW ALL THE QUESTIONS IN THE
ASSIGNMENT!
. . Your program assignment Write a program name DeskGUI that computes the price of a desk and whose button Click Event calls the following methods: • A method to accept the number of drawers in the desk as input from the key board. This method returns the number of drawers to the SelectDesk_Click event. A method...
please do for C# in visual studio.
For this exercise you are asked to write a Windows Forms application meeting the following specification. You may follow the worksheet for Practical 9 for step-by-step instructions on how to complete it The Form class must be named Form1. This is the default when creating a new Windows Forms app, but make sure that it doesn't change The form must be captioned Click Counter The form must contain a button with the text...
C# Windows Form Application (CALCULATOR): (This is the instruction below): Windows Calculator that will going to create a Windows Form Application that will mimics a calculator. This is the screenshot how it shouldl look like. Calculator It should have a textbox and the following buttons: + Addition - Subtraction * Multiplication / Division = Equals (Will perform the final calculation) C Clear (Will clear the text box) There will be no maximize or minimize buttons. The rules are these: 2...
VISUAL BASIC| URGENT!| For this situation I need an app that provides a TextBox in which the user can type text. Allow the user to select TimesNewRoman, Arial or Courier New from a ComboBox. Provide a Bold CheckBox, which, if checked, makes the text bold. Include Increase Font Size and Decrease Font Size Buttons that allow the user to scale the size of the font up or down, respectively, by one point at a time. Start with a font size...