hi every one
in my vb.net program I need to keep track if the buttom had been clicked befor or not or how many times it had beed clicked. I cant find the property
can u help me please.
thanks in advanced

Recommended Answers

Is it a Vb Winform Windows app or a ASP.NET Web app using VB.NET?

Jump to Post

All 3 Replies

try ,using viewstate or cookies to find the number of hits for a particular button in page_load()..
i.e, declare an global variable
and on button_click function ....

Is it a Vb Winform Windows app or a ASP.NET Web app using VB.NET?

'Try this

Dim intBtnClkCount as Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

intBtnClkCount+= 1

MessageBox.Show("Button1 has been clicked" & intBtnClkCount.ToString() & " times.")
End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.