Answers for "how to convert weeks to days into textbox with VB site:stackoverflow.com"

VBA
0

how to convert weeks to days into textbox with VB site:stackoverflow.com

'TextBox1 is where the user inputs the number of minutes
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    Dim d = TimeSpan.FromMinutes(TextBox1.Text) 'creates a TimeSpan based on user input, this is also a variable creation


    TextBox5.Text = d.ToString("dd\:hh\:mm") 'you can format it with a custom format


    'Or you can access the elements of the TimeSpan like so

    TextBox2.Text = d.Days
    TextBox3.Text = d.Hours
    TextBox4.Text = d.Minutes
End Sub
Posted by: Guest on October-15-2020

Code answers related to "how to convert weeks to days into textbox with VB site:stackoverflow.com"

Code answers related to "VBA"

Browse Popular Code Answers by Language