is it possible to run one code on differet events of different controls like vb.net???
how???

You can create a procedure for that. Example:

Sub Update()
    MessageBox.Show("A button was clicked.")
End Sub

Sub FirstButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    MessageBox.Show("FirstButton was clicked.")
    Update()
End Sub

Sub SecondButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    MessageBox.Show("SecondButton was clicked.")
    Update()
End Sub

Regards,
Emil Olofsson

That is how you reuse the same piece code.

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.