Toolbar

Post Reply
User avatar
fp
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Toolbar

Post 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
Frank-Peter
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Toolbar

Post by Enrico Maria Giordano »

Try to activate the toolbar during the ON INIT event of the DIALOG.

EMG
User avatar
fp
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Re: Toolbar

Post 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.
Frank-Peter
Post Reply