BevelButton.AddRow

From Xojo Documentation

Revision as of 22:41, 15 May 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

BevelButton.AddRow(Text as String)

Supported for all project types and targets.

Adds a row to the bottom of the menu and uses Text as the menu item. The menu items are constructed from a string array. A call to AddRow within a For loop builds the menu.

Sample Code

The following code creates a BevelButton menu.

Dim s As String
Dim last As Integer
s = "January,February,March,April,May,June,July,August,September," _
+ "October,November,December"
last = CountFields(s, ",")
Me.Caption = "Month"
Me.CaptionAlign = 0 // flush left
Me.HasMenu = 2 // menu on right
For i As Integer = 1 To last
Me.AddRow(NthField(s, ",", i))
Next