Skip to content

Style modules and classes

Attached controls can’t be styled with these systems, to detach, cut the label or other attached control and re-paste it.


There are a variety of different styling approaches being implemented.

Latest version of styling.

In these classes, methods are called and the styling is coded into the form itself.

Usage (in Form_Open):

Dim Style As ControlDesignerClass
Dim Layout As FormDesignerClass
Dim ctl As Control
On Error GoTo Error_Handler
Set Layout = New FormDesignerClass
Set Style = New ControlDesignerClass
Application.Echo False
Layout.Form = Me
Call Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)
Call Style.DefineColumnWidth(12, Me.Form.InsideWidth)
For Each ctl In Me.Form.Controls
Style.Control = ctl
With ctl
Select Case .Name
Case "txtRecordingID", "txtProjectID"
.Top = 0
.Left = 0
Style.DisplayHidden
Case "cmdOpenRecording", "imgRecordingType"
.width = Style.ColumnWidth * 1.5
.Top = Theme.HeightUnit * 0.5
.Left = 0
.ControlTipText = "Click to open chart"
Style.CenterOnWidth
Call Style.Mixin_ImageWithButton(bIsThumbnail:=True)
Case "txtSongTitle"
.width = Style.ColumnWidth * 7
.Top = Theme.HeightUnit * 0.5
.Left = Style.ColumnWidth * 1.5
.BorderWidth = 0
.BorderStyle = 0
Style.CenterOnWidth
Style.Text ("h3")
Case "txtRecordingType", "lblRecordingType"
.Top = Theme.HeightUnit * 0.5
.Left = Style.ColumnWidth * 8.5
.width = Style.ColumnWidth * 3.5
Style.Mixin_InputBox ("display")
Style.CenterOnWidth
Case "cmdGoToProjectSong"
.Top = Theme.HeightUnit * 1.5
.Left = Style.ColumnWidth * 1.5
.width = Style.ColumnWidth * 4
Style.Mixin_Button ("rounded")
Style.CenterOnWidth
End Select
End With
Next ctl
Application.Echo True
Dim Style As ControlDesignerClass
Dim ctl As Control
Set Style = New ControlDesignerClass
Call Style.DefineColumnWidth(12, Me.Form.InsideWidth)
For Each ctl In Me.Form.Controls
Style.Control = ctl
With ctl
Select Case .Name
Case "txtRecordingID", "txtProjectID"
.Top = 0
.Left = 0
Style.DisplayHidden
Case "cmdOpenRecording", "imgRecordingType"
.width = Style.ColumnWidth * 1.5
.Top = Theme.HeightUnit * 0.5
.Left = 0
.ControlTipText = "Click to open chart"
Style.CenterOnWidth
Style.Mixin_ImageWithButton(bIsThumbnail:=True)
Case "txtSongTitle"
.width = Style.ColumnWidth * 7
.Top = Theme.HeightUnit * 0.5
.Left = Style.ColumnWidth * 1.5
.BorderWidth = 0
.BorderStyle = 0
Style.CenterOnWidth
Style.Text ("h3")
Case "txtRecordingType", "lblRecordingType"
.Top = Theme.HeightUnit * 0.5
.Left = Style.ColumnWidth * 8.5
.width = Style.ColumnWidth * 3.5
Style.Mixin_InputBox ("display")
Style.CenterOnWidth
Case "cmdGoToProjectSong"
.Top = Theme.HeightUnit * 1.5
.Left = Style.ColumnWidth * 1.5
.width = Style.ColumnWidth * 4
Style.Mixin_Button ("rounded")
Style.CenterOnWidth
End Select
End With
Next ctl

The ordering of the propeties is important!

width and height, then positioning, those values are relied on by the other properties:

.width = Style.ColumnWidth * 3
.Top = Theme.HeightUnit * 5
.left = Style.ColumnWidth * 8

‘Component’ styles should be called next,

Call Style.Mixin_Button("rounded")

Style.CenterOnWidth must be called after .width.

Miscelaneous and Style overrides are last.

.ControlTipText = "Click to open chart"
Style.CenterOnWidth
Style.DisplayHidden
Style.Text ("h3")
Style.Mixin_Button ("rounded")
Style.Mixin_DeleteButton
Style.Mixin_ImageWithButton(bIsThumbnail:=True)

Mixin_InputBox(Optional strType As String = “default”, Optional withLabel = True)

strType
- default
- display
.width = Style.ColumnWidth * 1.5
.height = Me.Form.InsideHeight - Theme.HeightUnit * 0.5
.Top = 0
.Top = Theme.HeightUnit * 0.5
.Left = 0
.BackColor = Theme.LightColor
.BorderWidth = 0
.BorderStyle = 0
.ControlTipText = "Click to ..."
.FontSize = 18 ' 14, 18
.FontWeight = 600 '100=thin, 200=extra light, 300=light, 400=normal, 500=medium, 600=semi-bold, 700=bold, 800=extra bold, 900=heavy

Methods for setting the head, detail and footer.

SetDetail(3, Theme.MediumColor, Theme.LightColor)

Usage (in Form_Open):

Dim Layout As FormDesignerClass
Set Layout = New FormDesignerClass
Layout.Form = Me
Call Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)

Used by FormDesignerClass and ControlDesingerClass.

Example with colors

Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)

Example with sizes

Top = Theme.HeightUnit * 0.5

Deprecated method.

Class called on form open for styling the form, call individual styles per form.

This contains the styling for the form, alphabetically filtered.

Used in add songs.

used in setlist