Displaying Controls in a Balloon

A balloon can display labels and checkboxes. A label can be selected, or clicked, by the user and your code can determine which label was selected. To add labels to a balloon, use its Labels property. To “create” a label, all you need do is assign text to a label's Text property. The procedure in Listing 11.4 displays a list of choices to the user, then responds to the choice that was made. The balloon displayed by this code is shown in Figure 11.2.

Listing 11.4. Using labels to get user selections.
 Public Sub BalloonWithLabels() Dim myBalloon As Balloon Dim title As String Dim message As String Dim choice As Integer With Application.Assistant .On = True .Visible = True Set myBalloon = .NewBalloon End With title ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.