Click here to Skip to main content
12,824,299 members (40,952 online)

little help needed in this problem vb 2010

charuwaka asked:

Open original thread
i made a text 3 text boxes and one button in that three text boxes i enter

DOB like ex:21 07 1993 format in textboxes 4,5,6 i will get out put as 2+1+0+7+1+9+9+3=34>3+4=7 in that means 7 will come as output in 7th text box. my problem if enter b'day like :1 3 1986 > 1+3+1+9+8+6=28 > 2+8=10 here "10" is displayed in 7th text box. but i want output as 1+0= 1 i.e "1" as output(in case to two digit numbers) how can i do that please tell me

i tried this
Private Sub KryptonButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click
        Dim i As Integer = 0
        Dim l As Integer = 0
        Dim lcn As String
        If TextBox4.Text = "" And TextBox5.Text = "" Then
            MessageBox.Show("Please Enter Date of Birth!!!")
        End If
        For Each digit In (TextBox4.Text + TextBox5.Text + TextBox6.Text)
            i += Val(digit)
        lcn = i.ToString
        For Each digit In lcn
            l += Val(digit)
        TextBox7.Text = l.ToString

    End Sub

please help me read carefully once again before answering thanks to all:Merry Christmas!!!
Tags: VB, VB.NET


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100