VERSION 5.00 Begin VB.PropertyPage PVWTrendLegend Caption = "TrendControl" ClientHeight = 3495 ClientLeft = 0 ClientTop = 0 ClientWidth = 5925 PaletteMode = 0 'Rasterbild ScaleHeight = 3495 ScaleWidth = 5925 Begin VB.ListBox List1 Height = 3180 Left = 150 TabIndex = 0 Top = 150 Width = 5595 End End Attribute VB_Name = "PVWTrendLegend" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Option Explicit Private Sub List1_Click() Changed = True End Sub Private Sub PropertyPage_ApplyChanges() Dim ctr As Object 'TrendControl-Eigenschaft der UserControls setzen For Each ctr In SelectedControls ctr.TrendControl = List1.List(List1.ListIndex) Next ctr End Sub 'Prozedur, welche alle auf der Form 'vorhandenen TrendControls in die Liste schreibt Private Sub PropertyPage_SelectionChanged() Dim uctr As VWTrendLegend Dim ctr As Control Dim n As Integer Dim Container As Object Dim sTrend As String On Error Resume Next Set uctr = SelectedControls(0) Set Container = uctr.Container sTrend = uctr.TrendControl List1.Clear 'Schleife, die alle Controls des Containers (z.B. eines Formulars) durchläuft For Each ctr In Container.Controls 'Wenn aktuelles Control vom Typ VWTrend ist If TypeName(ctr) = "VWTrend" Then List1.AddItem ctr.Name If sTrend = ctr.Name Then List1.ListIndex = List1.NewIndex End If End If Next ctr End Sub