Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid & Combo & Valid.
Message
De
25/04/2000 06:04:34
 
 
À
25/04/2000 05:01:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00363023
Message ID:
00363040
Vues:
25
Hi Cemal.

>>When i click a command button on the form its run perfect.
But when i click a command button on a toolbar the valid event does not work.
Is this another bug? <<

No, this is not a bug. The problem here is that toolbars do not get focus. So the valid of the activeControl on the form does not fire. What you have to do is add a method to your form class, call it WriteBuffer, and SetFocus to the form's ActiveControl. Setting focus to it will cause its Valid to fire.

Code something like this:
LOCAL loControl, lnActiveColumn, loColumn

IF TYPE( '_Screen.Activeform.ActiveControl.Name' ) = 'C'
  loControl = _Screen.Activeform.ActiveControl
  IF LOWER( loControl.BaseClass ) = 'grid'
    *** Grids are special cases
    *** You have to specifically set focus to the active column
    *** in the grid. You have to loop through the grid's columns
    *** collection because active column actually refers to the grid's
    *** column order
    lnActiveColumn = loControl.ActiveColumn
    FOR EACH loColumn IN loControl
      IF loColumn.Columnorder = lnActiveColumn
        loColumn.Text1.SetFocus()
        EXIT
      ENDIF
    ENDFOR
  ELSE
    loControl.SetFocus()
  ENDIF
ENDIF
I wrote this code off the top of my head. It is untested and I do not guarantee that it is bug free. You will have to test it, but it gives you the general idea of what you need to do.

Marcia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform