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 PostHi,
You can use following code.'Declare a Date Time Variable Dim TempDateTime As DateTime = Nothing 'Declare a local time span variable Dim TempTimeSpan As New TimeSpan 'Declare a arry of type string and set the size equal to number of text boxes. Dim arr(4) As …
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.
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.