Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Simon Jones
  Where is Simon Jones?
 Market Drayton
 United Kingdom
 Simon Jones
 Tags
Subject: RE: Launching A Form From A Column In A Row In A Grid
Thread ID: 104584 Message ID: 104641 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Friday, August 18, 2006 5:42:38 PM         
   


> Thanks for the contributions, I have got this working, but I need some further logic and I am not sure if it is possible.
>
> To summarise i have a grid with column which has a checkbox as its currentcontrol. The image for the checkbox is the expand (+) and the down picture is the hide picture (-).
>
> The click on this control displays some futher information.
>
> However, the bit that I am stuck on is that only certain records in the grid should be able to display the expand / hide image, for the other records I would like to display the disabledpicture setting.
>
> Is it possible based on a flag(s) in the table to display in the same column for this control either the expand,hide or disabled pictures
>
> Thanks Simon


Try:
oForm = CREATEOBJECT([Form1])
oForm.Show(1)

**************************************************
*-- Form:            form1 (d:\all_zapl\test.scx)
*-- ParentClass:     form
*-- BaseClass:       form
*-- Time Stamp:      08/18/06 06:32:00 PM
*
DEFINE CLASS form1 AS form


    DataSession = 2
    Top = 0
    Left = 0
    Height = 250
    Width = 373
    DoCreate = .T.
    Caption = "Form1"
    Name = "form1"


    ADD OBJECT grid1 AS grid WITH ;
        ColumnCount = 2, ;
        Height = 200, ;
        Left = 19, ;
        Panel = 1, ;
        RowHeight = 26, ;
        Top = 8, ;
        Width = 320, ;
        Name = "Grid1", ;
        Column1.Sparse = .F., ;
        Column1.Name = "Column1", ;
        Column2.Sparse = .F., ;
        Column2.Name = "Column2"





    PROCEDURE Load
        CREATE CURSOR crsTest (Fld1 I, Fld2 C(20))
        FOR asd = 1 TO 20
            INSERT INTO crsTest VALUES (asd%3,TRANSFORM(asd))
        NEXT
        GO TOP
    ENDPROC


    PROCEDURE Init
        thisform.Grid1.Column1.AddObject([Spinner1],[Spinner])
        WITH thisform.Grid1.Column1.Spinner1
             .KeyboardHighValue = 2
             .KeyboardLowValue = 0
             .Left = 34
             .SpinnerHighValue =   2.00
             .SpinnerLowValue =   0.00
             .Top = 34
             .Visible = .t.
        ENDWITH
        thisform.Grid1.Column1.removeObject([Text1])
        thisform.Grid1.Column1.CurrentControl = [Spinner1]
        thisform.Grid1.Column1.Sparse  = .f.
        thisform.Grid1.Column2.AddObject([Image1],[Image])
        thisform.Grid1.Column2.AddObject([Image2],[Image])
        thisform.Grid1.Column2.AddObject([Image3],[Image])
        WITH thisform.Grid1.Column2.Image1
             .Picture = HOME()+"\graphics\bitmaps\assorted\delete.bmp"
             .Height  = 22
             .Left    = 20
             .Top     = 22
             .Width   = 24
        ENDWITH

         WITH thisform.Grid1.Column2.Image2
             .Picture = HOME()+"\graphics\bitmaps\assorted\happy.bmp"
             .Height  = 22
             .Left    = 20
             .Top     = 22
             .Width   = 24
        ENDWITH
        WITH thisform.Grid1.Column2.Image3
             .Picture = HOME()+"\graphics\bitmaps\assorted\heart.bmp"
             .Height  = 22
             .Left    = 20
             .Top     = 22
             .Width   = 24
        ENDWITH
        thisform.Grid1.Column2.removeObject([Text1])
        thisform.Grid1.Column2.CurrentControl = [Image1]
        thisform.Grid1.Column2.Sparse = .f.
        thisform.grid1.Column2.DynamicCurrentControl = [ICASE(Fld1 == 0,"Image1", Fld1 == 1, "Image2", "Image3")]
        BINDEVENT(thisform.grid1.Column1.Spinner1,[InterActiveChange],thisform,[SpinMe])
    ENDPROC


    PROCEDURE retyrnmyval
    ENDPROC


    PROCEDURE testassign
    ENDPROC


    PROCEDURE SpinMe
        AEVENTS(laEv,0)
***Grid1.Column1.spinner1.InteractiveChange
        Replace Fld1 WITH laEv[1].Value   
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************


Borislav Borissov



ENTIRE THREAD

Launching A Form From A Column In A Row In A Grid Posted by Simon Jones @ 8/17/2006 10:27:28 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Dexter Carlit @ 8/17/2006 10:51:38 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Simon Jones @ 8/18/2006 12:13:32 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Borislav Borissov @ 8/17/2006 10:57:32 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Simon Jones @ 8/18/2006 4:58:58 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Borislav Borissov @ 8/18/2006 5:42:38 PM
RE: Launching A Form From A Column In A Row In A Grid Posted by Simon Jones @ 8/18/2006 6:51:06 PM