Lightbox Effects with VFP Native Codes

The lightbox effect can be done with old native vfp codes simply using a shape you can try this code below

*!* this lightbox effect uses a shape but with some  transparency given by the
*!* drawMode property (here set to 9).No need to gdiplusX.
*!* you can have many other  effects with varying the shape backcolor property.
*!* codes modified from the original
*!* Thanks to idea Yousfi Benameur from Foxite.com

Public oForm
oForm=Newobject(“LigthBoxForm”)
oForm.Show
Read Events
Return

Define Class LigthBoxForm As Form
    Height = 422
    Width = 610
    AutoCenter = .T.
    Caption = “LigthBoxForm Sample Form”
    Name = “Form1”
    Icon = Home()+”graphics\icons\elements\earth.ico”

    Add Object shape1 As Shape With ;
        Top = 0, ;
        Left = 0, ;
        Height = Thisform.Height + 1, ;
        Width = Thisform.Width + 1, ;
        Anchor = 15, ;
        DrawMode = 9, ;
        Visible = .F., ;
        SpecialEffect = 0, ;
        BackColor = Rgb(70,70,70), ;
        Name = “Shape1”

    Add Object command1 As CommandButton With ;
        Top = 373, ;
        Left = 283, ;
        Height = 27, ;
        Width = 84, ;
        FontSize = 11, ;
        Caption = “Click me !”, ;
        MousePointer = 15, ;
        ForeColor = Rgb(255,0,0), ;
        BackColor = Rgb(255,255,255), ;
        anchor  = 12,;
        Name = “Command1”

    Add Object grid1 As Grid With ;
        Height = 300, ;
        Left = 40, ;
        Top = 51, ;
        Width = 512, ;
        anchor = 15,;
        Name = “Grid1”

    Procedure Load
        Select * From Home()+”samples\data\customer” Into Cursor ycurs
    Endproc

    Procedure Init
        With This.grid1
            .RecordSource=”ycurs”
            .AutoFit()
        Endwith
    Endproc

    Procedure command1.Click
        Thisform.shape1.Visible=.T.
        Thisform.shape1.ZOrder(0)
        Messagebox(“Run the form you want here”,0+32+4096,””)
        Thisform.shape1.Visible=.F.
    Endproc

    Procedure Destroy
        Clea Events
    Endproc

Enddefine

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s