vb.net - VB two buttons with multiple clicks, sync issue -


i have 2 buttons refer same forms, 1 allows information pasted in directly other putting information manually. when forms completed put results text box.

what happening if input method mixed, i,e pasted or manually inputted buttons become out of sync, button 1 may @ case 3 , button 2 case 5 may put results wrong box or replace existing result.

based on code below there way reference state of each button, example if button 2 @ case 3 open form 5 (example).

select case _step             case 0                 _step = 1                 if string.isnullorempty(me.textbox6.text)                     popupform.show()                 else                     form3.show()                 end if                 exit select              case 1                 _step = 2                 if string.isnullorempty(me.textbox7.text)                     form3.show()                 else                     loadform3.show()                 end if                  exit select              case 2                 _step = 3                 if string.isnullorempty(me.textbox8.text)                     loadform3.show()                 else                     loadform4.show()                 end if                 exit select 

public sub new()     addhandler button1.click, adressof firstclick end sub  private sub firstclick(byval sender system.object, byval e system.eventargs)      if string.isnullorempty(me.textbox6.text)                 popupform.show()      else                 form3.show()      end if removehandler button1.click, addressof firstclick addhandler button1.click, adressof secondclick     end sub  private sub secondclick(byval sender system.object, byval e system.eventargs)   if string.isnullorempty(me.textbox7.text)                 form3.show()   else                 loadform3.show()   end if end sub 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -