hi, I want to Count how many times i click a button and display the number in listview.
but i dont know the syntax for counting a button, can someone help me with this problem?
jez9
5
Junior Poster
Recommended Answers
Jump to PostIf you intend to do it with .Net then you would need to post back the button click to the server side code. There you would instantiate a class variable or session variable that held the current count and on each postback when the button was clicked you would increment …
Jump to PostDeclare an integer at the class level as in
Private ButtonClickCount As Integer = 0
Then in the button click event handler do
ButtonClickCount += 1 Me.Text = "Current count = " & ButtonClickCount
This will display the count in the title …
Jump to PostIf you try to hold the number, how many times you clicked a button, then Reverend Jim's technic is the perfect one.
But, if you want to show the numbers as an item in a listview like a serial no, simply add the ListView.Items.Count() + 1 as a item of …
All 12 Replies
hericles
289
Master Poster
Featured Poster
jez9
5
Junior Poster
Reverend Jim
4,578
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
Santanu.Das
125
Santanu Das
jez9
5
Junior Poster
Santanu.Das
125
Santanu Das
jez9
5
Junior Poster
Mr.M
58
Future Programmers
Santanu.Das
125
Santanu Das
Minimalist
96
Posting Pro
Santanu.Das
125
Santanu Das
jez9
5
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.