Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleMake a rotated bound ActiveX label control
Keywordsbound control, data, data control, ActiveX, label, rotate
CategoriesActiveX, Controls
 
Find the Data control. Save it to a local variable declared WithEvents. When the Reposition event occurs, find the control's value from the Data control's recordset.

Use CreateFont to draw the rotated text.

Note that this version only works for rotation angles between 0 and 90. It would not be hard to modify it for other angles.

 
Private WithEvents m_DataControl As Data

Public Property Let DataControlName(ByVal _
    New_DataControlName As String)
Dim ctl As Control

    m_DataControlName = New_DataControlName
    PropertyChanged "DataControlName"

    ' Find the control.
    For Each ctl In Extender.Parent.Controls
        If ctl.Name = m_DataControlName Then Exit For
    Next ctl
    If Not (ctl Is Nothing) Then Set m_DataControl = ctl
End Property

Private Sub m_DataControl_Reposition()
    If m_DataFieldName <> "" Then
        DrawValue _
            m_DataControl.Recordset.Fields(m_DataFieldName)
    End If
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated