Export (0) Print
Expand All

Location Object

Visual Studio .NET 2003

Represents the current position of a textual chart element such as the title, legend, or footnote.

Syntax

Location

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Example

The following example sets the title location for a chart using the Location object. To try the example, draw an MSChart and a ComboBox control on a form. Paste the code into the Form object's code module, and run the project. Click the ComboBox to change the title location.

Option Explicit

Private Sub Combo1_Click()
   MSChart1.Title.Location.LocationType = Combo1.ListIndex
End Sub

Private Sub Form_Load()
   ' Set Title Text.
   With MSChart1
      .TitleText = "Test Title Location"
      .Title.Location.Visible = True
   End With

   ' Add LocationType constants to ComboBox.
   With Combo1
      .AddItem "VtChLocationTypeTopLeft"     ' 0
      .AddItem "VtChLocationTypeTop"         ' 1
      .AddItem "VtChLocationTypeTopRight"    ' 2
      .AddItem "VtChLocationTypeLeft"        ' 3
      .AddItem "VtChLocationTypeRight"       ' 4
      .AddItem "VtChLocationTypeBottomLeft"  ' 5
      .AddItem "VtChLocationTypeBottom"      ' 6
      .AddItem "VtChLocationTypeBottomRight" ' 7
      .AddItem "VtChLocationTypeCustom"      ' 8
      .ListIndex = 0
   End With
End Sub

See Also

Properties, Methods, and Events | Footnote Object | Legend Object | Title Object

Show:
© 2014 Microsoft