Page 1 of 1

Toolbar

Posted: Mon Jan 30, 2006 10:53 am
by fp
I need a toolbar in a dialog. But it doesn't work (error-message: "cannot create window class TBAR").

Test4711() works
Test4712() doesn't work

why?

Code: Select all

*******************
FUNCTION Test4711()
*******************
LOCAL oWnd, oBar
DEFINE WINDOW oWnd TITLE "Test"
DEFINE BUTTONBAR oBar OF oWnd
ACTIVATE WINDOW oWnd VALID .T.
RETURN NIL

*******************
FUNCTION Test4712()
*******************
LOCAL oDlg, oBar
DEFINE DIALOG oDlg TITLE "Test"
DEFINE BUTTONBAR oBar OF oDlg
ACTIVATE DIALOG oDlg VALID .T.
RETURN NIL

Re: Toolbar

Posted: Mon Jan 30, 2006 11:20 am
by Enrico Maria Giordano
Try to activate the toolbar during the ON INIT event of the DIALOG.

EMG

Re: Toolbar

Posted: Mon Jan 30, 2006 11:55 am
by fp
Hello EnricoMaria,

thanks, it works now:

Code: Select all

*******************
FUNCTION Test4713()
*******************
LOCAL oWnd
DEFINE WINDOW oWnd TITLE "Test"
ACTIVATE WINDOW oWnd VALID .T. ON INIT OnInitUdf(oWnd)
RETURN NIL


*******************
FUNCTION Test4714()
*******************
LOCAL oDlg
DEFINE DIALOG oDlg TITLE "Test"
ACTIVATE DIALOG oDlg VALID .T. ON INIT OnInitUdf(oDlg)
RETURN NIL



****************************
STATIC FUNCTION OnInitUdf(o)
****************************
LOCAL oBar
DEFINE BUTTONBAR oBar OF o
RETURN .T.