Click here to Skip to main content
15,897,891 members
Articles / Programming Languages / Visual Basic

little help needed in this problem vb 2010

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
28 Dec 2012CPOL 0  
Try creating a function that will add the values. You can change the code below to what you want.Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim Day As String = "1" Dim Month As String = "3" Dim Year As String = "1986" ...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
28 Dec 2012Adam R Harris
For Each digit In (TextBox4.Text + TextBox5.Text + TextBox6.Text).ToCharArray() i += CInt(digit)Convert it to a CharArray first
Please Sign up or sign in to vote.
28 Dec 2012OriginalGriff
I would create a function, that took a string as it's parameter, and returned a value that was the digits added together.Private Function AddDigits(s As String) As Integer Dim result As Integer = 0 For Each c As Char In s If [Char].IsDigit(c) Then result +=...
Please Sign up or sign in to vote.
28 Dec 2012Thomas Daniels
Hi,Try this:Private Sub KryptonButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles KryptonButton1.Click Dim i As Integer = 0 Dim l As Integer = 0 Dim lcn As String = "" If String.IsNullOrEmpty(textBox4.Text) AndAlso String.IsNullOrEmpty(textBox5.Text)...
Please Sign up or sign in to vote.
28 Dec 2012Ashok19r91d
'' This is a Very Simple Solution applicable for any Number, It Based on Simple Maths' It so Easy, No need to Work with Loops or Goto's'' Any Number (Mod) 9 = Sum Of Digits'' 12 Mod 9 = 3' 21 Mod 9 = 3' 28 Mod 9 = 1 (2+8 = 1+0 = 1)' One Validation of Any Number / 9 = 0 then...
Please Sign up or sign in to vote.
28 Dec 2012charuwaka 5 alternatives  
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...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Nigeria Nigeria
Bond is a Physics student in a college in Nigeria.
Started programming right after high school and has fallen in love with computers ever since. Likes using the word 'seriously' and is a big fan of movies especially sci-fi.

Bond is a precise, honest, caring, down to earth gentleman.
He understands that being negative is easy. There will always be a downside to everything good, a hurdle to everything desirable and a con to every pro. He has realized that the real courage is in finding the good in what you have, the opportunities in every hurdle and the pros in every con.

Comments and Discussions