Help needed
I would like to know how to sum seven text boxes with time in vb.net.
Anybody can help me please?
Thanks
tonyfonseca 0 Newbie Poster
Recommended Answers
Jump to PostPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "3:05" TextBox2.Text = "1:00" TextBox3.Text = "0:55" Dim span As New TimeSpan span = TimeSpan.Parse(TextBox1.Text) + TimeSpan.Parse(TextBox2.Text) + TimeSpan.Parse(TextBox3.Text) TextBox4.Text = span.ToString End Sub
Jump to Postplease post the code you tried AND some example content of your textboxes.
Jump to Posttry this calculation :
'Calculation for Monday If Not Date.TryParse(MonInTextBox.Text, TimeA) Then End If If Not Date.TryParse(MonOutTextBox.Text, TimeB) Then End If Dim span As New TimeSpan span = TimeSpan.Parse(TimeB.ToShortTimeString) - TimeSpan.Parse(TimeA.ToShortTimeString) MonTotalTextBox.Text = span.ToString
All 12 Replies
navjyotnishant 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
tonyfonseca 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
tonyfonseca 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
tonyfonseca 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
tonyfonseca 0 Newbie Poster
GeekByChoiCe 152 Practically a Master Poster Featured Poster
tonyfonseca 0 Newbie Poster
abirami2908 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.