Basically I'm trying to display how long it takes to read words in a script. So what happens is this counts the number of words that are typed and divided that by in most cases 3(Avg words read in 1 second) but that can be changed in the text box.
So if the number of words divided by read time is under 60 we are good.
But if it is over it needs to be displayed in time.
If it was 90 seconds it needs to display 1:30
Updated Code:
Code:Option Explicit On Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim strInput As String strInput = RichTextBox1.Text Dim strSplit() As String strSplit = strInput.Split(CChar(" ")) Label2.Text = "Number of Words: " & strSplit.Length Label3.Text = "Read Time :" & CStr(Math.Round(strSplit.Length / TextBox1.Text)) End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click RichTextBox1.Text = "" Label2.Text = "Number of Words: " Label3.Text = "Read Time" End Sub Private Sub RichTextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles RichTextBox1.KeyDown If e.KeyCode = Keys.Enter Then Button1.PerformClick() End If End Sub End Class




Reply With Quote