Toolbar2000, dynamically adding TTBItems



I've created a toolbar which contains a TTBSubmenuItem. I then want to populate this submenu at runtime to create a vertical drop down menu.

I use the following code:

TTBItem * p;

for(int i=0; i<pSL->Count; i++)
{
p = new TTBItem(this);
p->Caption = pSL->Strings[i];
p->OnClick = ExampleMsgTxtClick;
btnMsg->Add(p);
}

Where btnMsg is a TTBSubmenuItem. When I run my app and click on btnMsg I get a horizontal menu displayed, when I want a vertical list of the TTBItems.

I've used similar code elsewhere in my App and it does create a verticall drop-down menu, however, the equivalent btnMsg and TIBItems use bitmaps (if that makes any difference).

Using TB2k 2.1.6

Any ideas?

Thanks

.