Q:

Formatting Time (HH:MM:SS)

I'm taking values from Numeric Ups and Downs for Hours, Minutes and Seconds.
The problem is that, for example, if the time for example is 9.15 am it will show as 9:15:0
What I want to do is format them so if any of the values(Hours, Minutes or seconds) is less than 10, it will add a 0 before the number so as the number shows as 09:15:00.
What I tried is this but it does not work:
Sub BtnSetClick(sender As Object, e As EventArgs)

        lbl8.Visible = True

        Dim nmTime As String = nmHour.Value.ToString + nmMin.Value.ToString + nmSec.Value.ToString

        lblST.Text.Format(nmTime.ToString, "HH:MM:SS")

        lblST.Text = (nmTime)

        lblST.Visible = True

    End Sub

A:

You seem to be doing it a bit backward by converting everything to string multiple times, try something like this:
Dim ts As new TimeSpan(CInt(nmHour.Value), CInt(nmMin.Value), CInt(nmSec.Value))
lblST.Text = ts.ToString("HH:MM:SS")

The documentation for TimeSpan.ToString is useful.
Edit: Updated the code to reflect Tim's comment about datatype.

A:

Try this:
Sub BtnSetClick(ByVal sender As Object, ByVal e As EventArgs)          

    lbl8.Visible = True          
    Dim nmTime As String = nmHour.Value.ToString().PadLeft(2, '0') + nmMin.Value.ToString().PadLeft(2, '0') + nmSec.Value.ToString().PadLeft(2, '0')            

    lblST.Text = nmTime          
    lblST.Visible = True      
End Sub 

