C# Tutorial Create your own Speed Reading Software
- Subject: C# Tutorials
- Learning Time: 2 hours
Form1 Full Source Code For Speed Reading Software
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 speedreadingsoftware
{
public partial class Form1 : Form
{
public int timerSet = 1;
public string words;
public string[] splitup;
public int totalWords;
public int counting = -1;
public int intervalSetting = 0;
secondForm readingScreen = new secondForm();
public Form1()
{
InitializeComponent();
}
private void startButton_Click(object sender, EventArgs e)
{
words = mainText.Text;
splitup = words.Split();
totalWords = splitup.Length;
int value = Convert.ToInt32(speedCombo.Text);
readingTimer.Interval = 100 * value;
readingScreen.Show();
readingScreen.isitCLosed = false;
readingTimer.Start();
}
private void readingTimer_Tick(object sender, EventArgs e)
{
counting++;
if (counting == totalWords || readingScreen.isitCLosed == true)
{
readingTimer.Stop();
MessageBox.Show("End of article");
counting = -1;
}
else
{
readingScreen.label1.Text = splitup[counting];
}
}
private void helpButton_Click(object sender, EventArgs e)
{
helpForm helpScreen = new helpForm();
helpScreen.Show();
}
}
}
Second Form Full Code
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 speedreadingsoftware
{
public partial class secondForm : Form
{
public bool isitCLosed = false;
public secondForm()
{
InitializeComponent();
}
private void changeClosing(object sender, FormClosingEventArgs e)
{
//Hiding the window, because closing it makes the window unaccessible.
this.Hide();
this.Parent = null;
e.Cancel = true; //hides the form, cancels closing event
isitCLosed = true;
}
}
}
Pages: 1 2