Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error setting Grid Dblclick event at run time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00543803
Message ID:
00544512
Vues:
16
>Hello to all,
>
>I get the error "Dblclick is read only" at run time when the statement below is encountered:
>
>thisform.mygrid.column1.text1.dblclick = 'thisform.command3.click()'
>
>Setting the dblclick event at design time works fine but is impractical because my grid columns need to be defined and displayed based on operator input.
>
>Any help would be greatly appreciated.
>
>Best Regards,
>
>Todd Hugus



For me, I do something different,

VFP don't allow you to change to dblclick code, but allow you to remove the "object" and re-add again.

Thus, I make an own grid and textbox class,

Grid add two new procedure: txtClick, txtDblclick
* Grd.Init

For ix = 1 to This.ColumnCount
  .Columns[ix].RemoveObject([Text1])
  .Columns[ix].Addobject([txt1], [txt])
  .Columns[ix].txt1.visible = .T.  && All object create by [Addobject] is default INvisible!
* .Columns[ix].txt1.font = [Arial]
* .Columns[ix].txt1.fontsize = 11
EndFor

* txt.Click

IF PEMSTATUS(This.Parent.Parent, [txtClick], 5)
  This.Parent.Parent.txtClick
Endif

* txt.DblClick

IF PEMSTATUS(This.Parent.Parent, [txtdblClick], 5)
  This.Parent.Parent.txtdblClick
Endif



The Grd.Txtdblclick proc is empty in class,
but you can add new coding on it after put in form.

So, you can use one proc grd.TxtDblclick to handle all dblclick event in grid.
Of cos, you can use ThisForm.Grd1.ActiveColumn == 2 to specify
which column is under control.

Anyway, this only gives you an idea how I handle group up all child object code into parent to control.

:) good luck!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform