user controls - The previous instances of usercontrol have the same values with last one. Why? -


in application (winform - using devexpress components), have tabs same usercontrol (with different values when control loading depending on user choice) them.

my problem usercontrol instances have same values last instance.

why happening ?

code in visual rpg.

(when user clicks button create new user control)

begsr managecreatenew     dclsrparm sender type(*object)     dclsrparm e type(devexpress.xtrabars.itemclickeventargs)      dclfld appcode type(*string)     dclfld filestatusparm type(*boolean)     dclfld parmcompany type(*char) len(3)     dclfld parmprotno type(*zoned) len(5,0)     dclfld parmprotyear type(*zoned) len(2,0)     dclfld tabform1 type(kyklades_menu_protocol.manageprotocol)     dclfld tabformsupplier type(kyklades_menu_supplier.supplierform)     dclfld infoboxresult type(dialogresult)     dclfld isprojectsubheaderopen type(*boolean) inz(*true)     dclfld suppliercodeparm type(*string)     dclfld isview type(*boolean)     dclfld isoldvsl type(*string) inz(" ")      try         managecreate = "create" + appcode         isprojectsubheaderopen = checkifprojectsubheadercopen(isprojectsubheaderopen)         if isprojectsubheaderopen = *false              barbuttonitem_save.enabled = *true             barbuttonitem_close.enabled = *true             barbuttonitem_new.enabled = *false             barbuttonitem_edit.enabled = *false             barbuttonitem_delete.enabled = *false              appcode = %subst(tabcontrolsubcategory.selectedtabpage.tag.tostring().trim(), 1, 3)             projectoption = %subst(tabcontrolsubcategory.selectedtabpage.tag.tostring().trim(), 4, 3)              if projectoption = '005'                 filestatusparm = *true                 selectionparm = *true                 parmcompany = *blanks                 parmprotno = *zeros                 parmprotyear = *zeros                 isview = *false                 issaved = *false                 tabform1 = *new kyklades_menu_protocol.manageprotocol(filestatusparm,parmcompany,parmprotno,parmprotyear,isoldvsl,isview)                 tabform1                 .dock = system.windows.forms.dockstyle.fill                 endwith                 tabpagesubcategoryheader = *new devexpress.xtratab.xtratabpage()                 tabpagesubcategoryheader                     .imageindex = filelibrary.appimg //image                     .name = projectoption + "managecreate"                     .dock = system.windows.forms.dockstyle.fill                     .size = *new system.drawing.size(525i, 343i)                     .text = "create protocol"                     .tag = "managecreate"                     .controls.add(tabform1 *as control)                 endwith                  tagstring = "create"+appcode              endif 

it's first time of using vs info. think when user change tab (in point) have right instance of user control ? correct ?

i find solution problem.

for info iam using asna visual rpg 14 visual studio 2015.

the problem had deceleration of object , use of shared parameter.

from asna newsletter.

terminology confusion aware avr , vb use shared indicate variable owned class, opposed non-shared members owned class instances. avr , vb both use static indicate variable’s value persists across routine calls.

thanks


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -