-
Notifications
You must be signed in to change notification settings - Fork 33
/
modControlProperties.bas
45 lines (42 loc) · 2.17 KB
/
modControlProperties.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Attribute VB_Name = "modControlProperties"
Option Explicit
' control default properties
Public Function ConvertControlProperty(ByVal Src As String, ByVal vProp As String, ByVal cType As String) As String
'If IsInStr(vProp, "SetF") Then Stop
ConvertControlProperty = vProp
Select Case vProp
Case "ListIndex": ConvertControlProperty = "SelectedIndex"
Case "Visible": ConvertControlProperty = "Visibility"
Case "Enabled": ConvertControlProperty = "IsEnabled"
Case "TabStop": ConvertControlProperty = "IsTabStop"
Case "SelStart": ConvertControlProperty = "SelectionStart"
Case "SelLength": ConvertControlProperty = "SelectionLength"
Case "Caption"
If cType = "VB.Label" Then ConvertControlProperty = "Content"
Case "Value"
If cType = "VB.CheckBox" Then ConvertControlProperty = "IsChecked"
If cType = "VB.OptionButton" Then ConvertControlProperty = "IsChecked"
If cType = "MSComCtl2.DTPicker" Then ConvertControlProperty = "DisplayDate"
Case "Text"
If cType = "VB.ListBox" Then ConvertControlProperty = "SelectedText.toString()"
Case "ListCount"
If cType = "VB.ListBox" Then ConvertControlProperty = "Items.Count"
Case "Default": ConvertControlProperty = "IsDefault"
Case "Cancel": ConvertControlProperty = "IsCancel"
Case "LBound": ConvertControlProperty = "LBound()"
Case "UBound": ConvertControlProperty = "UBound()"
Case ""
Select Case cType
Case "VB.Caption": ConvertControlProperty = "Content"
Case "VB.TextBox": ConvertControlProperty = "Text"
Case "VB.ComboBox": ConvertControlProperty = "Text"
Case "VB.PictureBox": ConvertControlProperty = "Source"
Case "VB.Image": ConvertControlProperty = "Source"
Case "VB.OptionButton": ConvertControlProperty = "IsChecked"
Case "VB.CheckBox": ConvertControlProperty = "IsChecked"
Case "VB.Frame": ConvertControlProperty = "Content"
Case "VB.Label": ConvertControlProperty = "Content"
Case Else: ConvertControlProperty = "DefaultProperty"
End Select
End Select
End Function