Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Click on desabled items ( how to prevent after item beco
Message
 
À
28/09/1999 01:04:19
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00266970
Message ID:
00269914
Vues:
20
>>>My memory propably became weak, I know for sure I have known the answer on the problem, but have forget it.
>>>Here is the problem
>>>We have form and some button with code
>>>We run some method on this button or other button
>>>The proccess takes some time and we meke the button
>>>being desabled on the time of the proccess
>>>and will make it enabled after proccess was over
>>>If to click desabled button , the code will work after the
>>>button will become enabled
>>>typeahead command fix problems with keyboard keeping stack.
>>>What command, set or function will prevent keeping clicks of the mouse
>>>So, roughly saying , I don't like the user will click on desabled item and the code of the click event under this button will work, when button will be enabled.
>>>Thanks in advance
>>>Vladimir Zhuravlev
>>
>>Assuming you are using the click event of the button, something like:
>>
>>This.Enabled = .F.
>>Code segment here...
>>....
>>End of code segment...
>>This.Enabled = .T.
>>
>>I'm not sure if I understand the question entirely, but it sounds like you also want to clear the keyboard buffer as well? If so, try:
>>
>>CLEAR TYPEAHEAD
>>
>>HTH, Bill
>You are right, it is exactly, what I mean.
>Yes I did it, but it did not prevent mouse click , only keyboards,
>I also added inkey('MH') -much better,
>but waht to do with the rest of buttons, which are enabled and ready to get
>working, when other procces is going under disabled button.
>It is important problem in VFP6+SP3 in multithread mode.

The same concept would apply to the other buttons, just change the reference. As an example, say you have 3 buttons you want to disable name cmdButton1, cmdButton2, and cmdButton3. Lets also say the buttons are in a PageFrame on the form and the PageFrame is pgfMain and the Form name is frmMyForm. Final assumption is that cmdButton1 is the button the user clicks and you want to disable that one and the other 2 as well. The code would be:

This.Enabled = .F.
This.frmMyForm.pgfMain.cmdButton2.Enabled = .F.
This.frmMyForm.pgfMain.cmdButton3.Enabled = .F.
Code segment here...
....
End of code segment...
This.Enabled = .T.
This.frmMyForm.pgfMain.cmdButton2.Enabled = .T.
This.frmMyForm.pgfMain.cmdButton3.Enabled = .T.

You could also do:
This.Enabled = .F.
This.Parent.cmdButton2.Enabled = .F.
This.Parent.cmdButton3.Enabled = .F.
Code segment here...
....
End of code segment...
This.Enabled = .T.
This.Parent.cmdButton2.Enabled = .T.
This.Parent.cmdButton3.Enabled = .T.

yet another way:
This.Enabled = .F.
ThisForm.pgfMain.cmdButton2.Enabled = .F.
ThisForm.pgfMain.cmdButton3.Enabled = .F.
Code segment here...
....
End of code segment...
This.Enabled = .T.
ThisForm.pgfMain.cmdButton2.Enabled = .T.
ThisForm.pgfMain.cmdButton3.Enabled = .T.

Everyone has their own style and all of the above (and probably more I didn't think of) would work. The second one is my preference as it allows the buttons to be moved to any container (albeit moved to the form or to another page frame or even a container within a page frame) and the reference is still correct. HTH, write back if you need clarification.
Oct 31 = Dec 25
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform