Hello,
Anyone have any idea how I can take a label that has a number lets say 90 and convert it to time so that means it would display 1:30 but I dont want to do 90/60 =1.50 I need the label (Seconds) to display in time. Right Now I'm looking to have that display with label3
Code:Option Explicit On Public Class Form1 Dim SecondsDifference As Integer = 2500 Dim hms = TimeSpan.FromSeconds(SecondsDifference) Dim h = hms.Hours.ToString Dim m = hms.Minutes.ToString Dim s = hms.Seconds.ToString 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 ' Label1.Text = Math.Round(Val(Label1.Text), 2) ' Label3.Text = "Read Length: " & strSplit.Length / 3 Label3.Text = "Read Time :" & CStr(Math.Round(strSplit.Length / TextBox1.Text)) & " Seconds" ' If Label3.text > 61 Then / 60 ' End If 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