Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Toolbar hide and show problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01103373
Message ID:
01103429
Views:
18
>Hi Borislav
>
>Thanks. With a bit of changes to suite my code it works great. Only one problem. The cold will only work if I actually close the form. I want to be able to hide the toolbar if I minimize the form and if i maximize the form it must show again.
>
>I have a property on each form to determine if the form has a toolbar, but I do not know how to access it this property from the toolbar

Try this:
oApp  = CREATEOBJECT([MyApplication])
oForm = CREATEOBJECT([Test])
oForm.Show()
oForm1 = CREATEOBJECT([Test])
oForm1.Show()
READ EVENTS 


**************************************************
*-- Form:         test (d:\all_zapl\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   03/11/06 07:29:05 PM
*
DEFINE CLASS Test AS form


    DoCreate = .T.
    Caption = "Form"
    test = .F.
    Name = "Test"

    PROCEDURE Init
        oApp.ShowToolBar()
    ENDPROC


    PROCEDURE Resize
        IF this.WindowState = 1 
           oApp.RemoveToolBar()
        ELSE
           oApp.ShowToolBar()
        ENDIF
    ENDPROC

    PROCEDURE Destroy
        oApp.RemoveToolBar()
        CLEAR EVENTS
    ENDPROC

ENDDEFINE
*
*-- EndDefine: test
**************************************************


DEFINE CLASS MyApplication AS Custom
     nShowToolBar = 0
     oToolBar     = NULL

     PROCEDURE ShowToolBar
        IF ISNULL(this.oToolBar)
            this.oToolBar = CREATEOBJECT([ToolBar])
            this.oToolBar.AddObject([Command1],[CommandButton])
            this.oToolBar.Command1.Visible = .t.
            this.oToolBar.Show()
        ENDIF
        this.nShowToolBar = this.nShowToolBar + 1
     ENDPROC
     
     PROCEDURE RemoveToolBar
         this.nShowToolBar = this.nShowToolBar - 1
         IF this.nShowToolBar < 1
            this.oToolBar = NULL
         ENDIF
     ENDPROC
ENDDEFINE
In that example if you close any of the forms you issue CLEAR EVENTS ;o)))
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform