Hey guys I have been to try to make this program but I get nowhere. It is just w
ID: 3633749 • Letter: H
Question
Hey guys
I have been to try to make this program but I get nowhere. It is just wrong. So then I ask someone who is good at this.
As usual, I am grateful for those who hate helped me and I always give lifesaver for people who help me because it is deserved.
What I trying to make is this task:
Develop a Windows Form application allows the user to test their reaction.Name list is optional. After start is pressed to pass a random period (between 100 and 3500 ms) before anything visually on the screen (in random space). The program will then take the time from this case the user is able to react and, for example, pressing the left mouse button.
The result will appear in a MESSAGEBOX in a list. Be sure to have clean code where naming classes, methods, members and constituents in a proper manner. Also ensure that the code is well documented (use / / / in front of methods and classes to generate method / class-header).
I have done what I have managed here:
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.Windows.Forms;
namespace Test
{
public partial class Form1 : Form
{
public Form1();
private Random value = new Random();
int num = value.NextInt(100,3500);
}
private void label1_Click(object sender, EventArgs e)
{InitializeComponent();
timer1.tick = num ;
timer1.Start();
timer1.Stop();
MessageBox.Show (string object);
}
}
================================================================================
Form1.Designer.cs:
namespace Test
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
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.components = new System.ComponentModel.Container();
this.button1 = new System.Windows.Forms.Button();
this.Resultusers = new System.Windows.Forms.ListBox();
this.Names = new System.Windows.Forms.TextBox();
this.Test = new System.Windows.Forms.ListBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(146, 230);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "Start";
this.button1.UseVisualStyleBackColor = true;
//
// Resultusers
//
this.Resultusers.FormattingEnabled = true;
this.Resultusers.Location = new System.Drawing.Point(380, 53);
this.Resultusers.Name = "Resultusers";
this.Resultusers.Size = new System.Drawing.Size(120, 173);
this.Resultusers.TabIndex = 2;
//
// Names
//
this.Names.Location = new System.Drawing.Point(381, 22);
this.Names.Name = "Names";
this.Names.Size = new System.Drawing.Size(120, 20);
this.Names.TabIndex = 4;
this.Names.Text = " ";
//
// Test
//
this.Test.FormattingEnabled = true;
this.Test.Location = new System.Drawing.Point(12, 12);
this.Test.Name = "Test";
this.Test.Size = new System.Drawing.Size(363, 30);
this.Test.TabIndex = 5;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.ClientSize = new System.Drawing.Size(536, 276);
this.Controls.Add(this.Test);
this.Controls.Add(this.Names);
this.Controls.Add(this.Resultusers);
this.Controls.Add(this.button1);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Name = "Form1";
this.Text = "Reaction Test";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ListBox Resultusers;
private System.Windows.Forms.TextBox Names;
private System.Windows.Forms.ListBox Test;
private System.Windows.Forms.Timer timer1;
}
}
==============================================================================
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Test
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Explanation / Answer
dear friend! check the following links.... and plz don't miser in lifesaver. www.youtube.com/watch?v=KdZAvW7WYJU http://msdn.microsoft.com/en-us/library/aa302342.aspx http://www.codeproject.com/KB/miscctrl/ i am sure that here you find ur required things. thx