vb.net - Sub executed before another -


i have following sub

public sub transfer()         dim integer         dim j integer         dim k integer         dim searching_date string         dim name string         dim presente boolean         dim foto_presente boolean           = 0 cdii - 1             searching_date = image_date(camera_day_images(i))             name = replace(camera_day_images(i), camera & path_in_camera & "\", "")              presente = false             j = 0             while (not presente , j <= pci)                 if (path & "\" & right_date(searching_date)) = pc_directory(j)                     presente = true                 else                     presente = false                 end if                 j = j + 1             end while              if presente = true                 foto_presente = false                 k = 0                 list_pc_day_images(path & "\" & right_date(searching_date))                 while (not foto_presente , k <= pdii)                     if (path & "\" & right_date(searching_date) & "\" & name) = pc_day_images(k)                         foto_presente = true                     else                         foto_presente = false                     end if                     k = k + 1                 end while                 if foto_presente = true                  else                     my.computer.filesystem.copyfile(camera & path_in_camera & "\" & name, path & "\" & right_date(searching_date) & "\" & name)                     pc_day_images(pdii) = path & "\" & right_date(searching_date) & "\" & name                     pdii = pdii + 1                 end if              else                 my.computer.filesystem.createdirectory(path & "\" & right_date(searching_date))                 my.computer.filesystem.copyfile(camera & path_in_camera & "\" & name, path & "\" & right_date(searching_date) & "\" & name)             end if         next         principale.lfine.text = "tutte le tue foto sono state trasferite con successo"         principale.button1.enabled = false     end sub 

it copies photos device computer. if have lot of photos can take several time , want notify this. in fact change text in label, call sub , rechange label.

private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click         lfine.text = "attendere prego..."         transfer()         lfine.text = "operazione completata con successo"     end sub 

but results transfer () starts , after finished changing label.

why??? how can fix problem?? thank you.

after lfine.text = "attendere prego..." add line:

lfine.update() 

see https://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.control.update(v=vs.100).aspx


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -