|
-
Feb 8th, 2010, 04:00 PM
#14
Thread Starter
Fanatic Member
Re: How many"k" are in my textboxes
cicatrix
is correct this code because the textbox says 2 and the k are 5
Private Sub Button72_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'HOW MANY K
Dim myCol As New List(Of Label)
myCol.Add(Label201)
myCol.Add(Label200)
myCol.Add(Label199)
myCol.Add(Label198)
myCol.Add(Label197)
myCol.Add(Label196)
myCol.Add(Label195)
myCol.Add(Label193)
myCol.Add(Label190)
myCol.Add(Label189)
myCol.Add(Label188)
myCol.Add(Label185)
myCol.Add(Label181)
myCol.Add(Label178)
Dim CharCounter As Integer = 0
For Each label As Label In Me.Controls.OfType(Of Label)()
Dim c = Aggregate chars In label.Text Where chars = "k"c Into Count()
CharCounter += c
Next
num34TextBox.Text = CharCounter.ToString
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|