1 Replies - 557 Views - Last Post: 20 August 2009 - 07:01 PM Rate Topic: -----

#1 arvinsmith19  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-August 09

Need help counting checkboxes

Posted 20 August 2009 - 06:54 PM

I need a code that counts the number of check boxes in a form this is my cod
Public Class frmCount

Dim counter As integer = 0

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		
	if checkbox1.checked then
	   integer = integer +1
	 end if
   
if checkbox2.checked then
	  integer = integer +1
	 end if

		textbox1.text = integer


	End Sub
End Class



The code that i used is not working.. please help me....

Mentor Edit: :code:

This post has been edited by AdamSpeight2008: 20 August 2009 - 06:57 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Need help counting checkboxes

#2 citricube  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 73
  • Joined: 21-January 08

Re: Need help counting checkboxes

Posted 20 August 2009 - 07:01 PM

Public Class frmCount

Dim counter As integer = 0

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
	   
	if checkbox1.checked then counter += 1

   
if checkbox2.checked then counter += 1


		textbox1.text = counter


	End Sub
End Class


Mentor Edit: Removing quoted original post.

This post has been edited by AdamSpeight2008: 20 August 2009 - 07:09 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1