|
|
Title | Make a rotated bound ActiveX label control |
Keywords | bound control, data, data control, ActiveX, label, rotate |
Categories | ActiveX, 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
|
|
|
|
|
|