On 2003-11-29, AussieRules <so*****@nowhere.com> wrote:
Hi,
I have heaps(50+) of text boxs on a form.
I want to have an dirtyflag type property that is set when any one of the 50
text boxes is change, so that i can prompt the user to save changes should
they exit.
Is there a easy way to do this against all 50 in one go, rather than have an
event to set the dirty flag against each text box ?
Thanks
Set all of them to be handled by the same event...
Private Sub Changed(ByVal sender As Object, ByVal e As EventArgs) Handles _
TextBox1.TextChanged, _
TextBox2.TextChanged, _
TextBox3.TextChanged, _ ...
dirty = True
End Sub
Of course, you can also do it dynamically using AddHandler and
RemoveHandler...
--
Tom Shelton
MVP [Visual Basic]