Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removeobject skips some objects
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00835738
Message ID:
00835799
Views:
9
Because vapps may have changed which will add and/or remove buttons. The buttons are disabled as soon as the user clicks them. This is because some of the apps they launch have a lag time of maybe 60 seconds or so before they appear. We found that if we don't disable the button, the users click repeatedly (starting the app maybe 20 times) before they see the app start. The timer re-enables the button after a pause of about 90 seconds. So as far as I can tell, I need a timer for each button.

>Joe,
>
>Why exactly are you doing this, removing objects only to come back and add them right back in? You definately don't want to be using one timer per button either. It's far better to use a single timer that iterates the container and manipulates the buttons.
>
>>I call this code during the form init and occasionally to refresh the buttons on a form. The second time it only removes the MenuButtons and not the ButtonTimers which causes a crash when adding the timers back in. What am I doing wrong?
>>
>>
>>FOR EACH loAppControl IN thisform.cntButtons.objects
>>	thisform.cntButtons.RemoveObject(loAppControl.name)
>>ENDFOR
>>
>>SELECT vapps
>>REQUERY()
>>SCAN FOR vapps.lactive
>>	NewButton='cmd'+ALLTRIM(vapps.cObjName)
>>	thisform.cntButtons.addobject(NewButton,'MenuButton')
>>	
>>	NewTimer='tmr'+ALLTRIM(vapps.cObjName)
>>	thisform.cntButtons.AddObject(NewTimer,'ButtonTimer')
>>endscan
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform