I am trying too add buttons to a toolbar based on settings in SQLite. the Property MenuHead(20) is defined as DesktopToolbarItem. I have the following code in the openning event for the DesktopToolBar
/// Load Menu on toolbar
try
var rs as RowSet
Var ct as Integer = 1
rs = wTL.db.SelectSQL(“select HeadSeq, Label from TL_MENU_HEAD order by HeadSEQ ;”)
MenuHead() = New DesktopToolbarItem
// The following compile error shows
// wTL.tbMenu1.Opening, line 9
// The constructor of this class is protected, and can only be called from within this class
// MenuHead() = New DesktopToolbarItem
For Each Row As DatabaseRow In rs
if MenuHead(ct) is Nil then
MenuHead(ct).Caption = rs.Column("Label").StringValue
MenuHead(ct).Name = rs.Column("Label").StringValue
tbMenu1.AddButton(MenuHead(ct))
MenuHead(ct).ButtonStyle = DesktopToolbarButton.ButtonStyles.DropDownMenu
//....
//... Code to add entries to the drip down menus
//....
ct = ct + 1
Next
rs.Close
Catch error As DatabaseException
MessageBox(wTL.db.ErrorMessage)
End Try