CommandBar.Position

This property returns/sets the position of the command bar (bottom, floating, left, menu bar, pop up, right, top).

Syntax Parameters Return Value
- - BarPosition

SVB Example

Adding a custom toolbar:

Sub Main

    'Note that this example assumes that you are
    'using the classic menu/toolbar Statistica UI.
    Dim qBar As CommandBar

    Const QBARTITLE As String = "Query"
    Const QBARBUTTN1 As String = "Run"
    Const QBARBUTTN2 As String = "New"
    Const QBARBUTTN3 As String = "Edit"
    Const QBARBUTTN4 As String = "Properties"
    Const QBARBUTTN6 As String = "Refresh"
    Const QBARBUTTN7 As String = "Delete"
    Const QBARBUTTN8 As String = "Cancel"

    On Error GoTo AddToolbar

    'Query Toolbar was found; don't need to add it
    Set qBar = CommandBarOptions.CommandBars(scBarTypeToolBar).FindItem(QBARTITLE)
    Exit Sub

    'Couldn't find the Query Toolbar, so add it
    AddToolbar:
    Set qBar = CommandBarOptions.CommandBars(scBarTypeToolBar).Add(QBARTITLE)

    qBar.InsertButton 1, scCmdFileExternalDataOpenQueryfromFile, , QBARBUTTN1
    qBar.InsertButton 2, scCmdFileExternalDataCreateQuery, , QBARBUTTN2
    qBar.InsertButton 3, scCmdFileExternalDataEditQuery, , QBARBUTTN3
    qBar.InsertButton 4, scCmdFileExternalDataProperties, , QBARBUTTN4
    qBar.InsertSeparator 5
    qBar.InsertButton 6, scCmdFileExternalDataRefreshData, , QBARBUTTN6
    qBar.InsertButton 7, scCmdFileExternalDataDeleteQuery, , QBARBUTTN7
    qBar.InsertButton 8, scCmdFileExternalDataCancelQuery, , QBARBUTTN8

    qBar.Position = scBarTop

End Sub