Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINDEVENT() and show
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01018223
Message ID:
01018230
Views:
18
>Is there a problem with this command? I think it causes an C..05 error.
>
>BINDEVENT(THISFORM,"SHOW",THIS,"SET_FORM_SIZE",1)
>
>I have it in the INIT of a class that is on a form. I want to run my "SET_FORM_SIZE" method after the form INIT. Using BINDEVENT(THISFORM,"ACTIVATE",THIS,"SET_FORM_SIZE",1) does work but the form flashes before it is sized.

Patrick,
This code works for me
x1 = CREATEOBJECT("Form1")
x1.Show()
ON KEY LABEL ESC CLEAR EVENTS
READ EVENTS
**************************************************
*-- Form:         form1 (c:\program files\microsoft visual foxpro 9\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   05/27/05 09:09:07 PM
*
DEFINE CLASS form1 AS form


    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"


    PROCEDURE set_form_size
        this.Height = this.Height * 2
        this.Width = this.Width * 1.5
    ENDPROC


    PROCEDURE Init
        BINDEVENT(THISFORM,"SHOW",THIS,"SET_FORM_SIZE",1)
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform