Control & Tag Properties
===

I am working with a windows form application,using vb.net as language and visual studio as platform.

I am trying to write a function called hasUnsavedChanges which basically Should be called when you are closing the form i.e after saving the item,Checkes the Values in the controls against the values in tag property which are in the same function e.g   txtFirstName.Tag = .ContactFirstname &   txtFirstName.Text = .ContactFirstname. If any difference return true.On closing the form if this function returns true, then ask for save changes. If positive, call the save function.

I think the right way would be to write a For loop to loop through the controls but i am stuck after that can someone please put me on the right track please.