Click here to Skip to main content

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)
        Next
        lcn = i.ToString
        For Each digit In lcn
            l += Val(digit)
        Next
        TextBox7.Text = l.ToString
 
    End Sub
 

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

Preview



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
Web03 | 2.8.140415.2 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid