Please edit your post and put your code between [code] [/code] tags.
Then tell us what you expect us to do about it? There are a bunch of completely unknown functions, unknown numbers of loops, no idea what "a very long time", where you have measured the slow points to be, why you do this in a button click event is etc...
Bookmarks