-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfrmProperties.frm
1481 lines (1294 loc) · 60.7 KB
/
frmProperties.frm
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmProperties
BorderStyle = 0 'None
Caption = "属性"
ClientHeight = 2760
ClientLeft = 0
ClientTop = 0
ClientWidth = 3075
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2760
ScaleWidth = 3075
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox picContainer
BorderStyle = 0 'None
Height = 1695
Left = 0
ScaleHeight = 1695
ScaleWidth = 2775
TabIndex = 1
Top = 0
Width = 2775
Begin VB.CommandButton cmdDropdownList
Height = 252
Left = 600
Picture = "frmProperties.frx":0000
Style = 1 'Graphical
TabIndex = 7
Top = 960
Visible = 0 'False
Width = 252
End
Begin VB.ComboBox comProp
Height = 315
ItemData = "frmProperties.frx":038A
Left = 120
List = "frmProperties.frx":038C
Style = 2 'Dropdown List
TabIndex = 6
Top = 480
Visible = 0 'False
Width = 975
End
Begin VB.CommandButton cmdCall
Height = 252
Left = 120
Picture = "frmProperties.frx":038E
Style = 1 'Graphical
TabIndex = 5
Top = 960
Visible = 0 'False
Width = 252
End
Begin VB.TextBox edProp
Height = 270
Left = 120
TabIndex = 4
Top = 1320
Visible = 0 'False
Width = 855
End
Begin VB.Label labPropName
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 270
Index = 0
Left = 0
TabIndex = 3
Top = 0
Visible = 0 'False
Width = 1440
End
Begin VB.Label labPropValue
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
ForeColor = &H80000008&
Height = 270
Index = 0
Left = 1440
TabIndex = 2
Top = 0
Visible = 0 'False
Width = 1320
End
End
Begin MSComDlg.CommonDialog CDL
Left = 2160
Top = 1800
_ExtentX = 847
_ExtentY = 847
_Version = 393216
CancelError = -1 'True
End
Begin VB.VScrollBar ScrollBar
Height = 2655
Left = 2760
Max = 100
TabIndex = 0
Top = 0
Width = 255
End
End
Attribute VB_Name = "frmProperties"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public NowPropList As Collection '当前的属性列表
Public NowIndex As Integer '当前选择的属性的序号
Public CurrentTarget As Integer '当前更改属性的对象 【0是窗体】
Public PropSetTarget As Object 'CallByName将要设置属性的对象
Dim sString() As String '用来放置分割好的属性参数
'设置目标物件的属性或者样式
' 描述:用来设置目标物件的属性或者样式
'必选参数:ChangeMode:设置模式,True为设置属性,False为设置样式
'可选参数:当是设置属性模式(True)时,需要指定属性名称PropName和属性值PropValue;
' 当是设置样式模式(False)时,需要制定增加的样式StyleAdd和去除的样式StyleRemove
' 返回值:无
Sub ApplyProp(ChangeMode As Boolean, _
Optional PropName As String, Optional PropValue, _
Optional StyleAdd As Long = 0, Optional StyleRemove As Long = 0)
On Error Resume Next
If ChangeMode = True Then '为设置属性模式
CallByName PropSetTarget, PropName, VbLet, PropValue '使用CallByName设置目标属性
Else '为设置样式模式
Dim PrevLong As Long
If PropSetTarget.Name <> "frmTarget" Then '如果是图片框说明是用来放置控件的容器,下同
PrevLong = GetWindowLong(Split(PropSetTarget.Tag, "|")(0), GWL_STYLE) '获取里面的控件的样式
Else
PrevLong = GetWindowLong(PropSetTarget.hWnd, GWL_STYLE)
End If
PrevLong = PrevLong And (Not StyleRemove) '进行数位运算
PrevLong = PrevLong Or StyleAdd
If PropSetTarget.Name <> "frmTarget" Then
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_STYLE, PrevLong '设置里面的控件的样式
Else
SetWindowLong PropSetTarget.hWnd, GWL_STYLE, PrevLong '否则直接设置目标控件的样式
End If
End If
End Sub
'根据属性ID来更改目标对应的属性或者样式
' 描述:根据当前属性对应的属性ID来设置目标对象对应的属性或者样式
'必选参数:无
'可选参数:无
' 返回值:无
Sub SetProp()
Dim CurrentPropValue As String '当前的属性值
CurrentPropValue = Me.labPropValue(NowIndex).Caption '通过标签的按钮获取当前的属性值
IsSaved = False '记录当前工程已更改
Select Case sString(0) '根据属性的ID设置对应的属性
'窗体属性列表
Case 1, 2
'窗体标题
'设置窗体的标题属性
ApplyProp True, sString(2), CurrentPropValue
Case 3
'最大化按钮
If CBool(CurrentPropValue) = True Then '最大化按钮可用
ApplyProp False, , , WS_MAXIMIZEBOX
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_MAXIMIZEBOX
Else '最大化按钮不可用
ApplyProp False, , , , WS_MAXIMIZEBOX
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_MAXIMIZEBOX)
End If
Case 4
'最小化按钮
If CBool(CurrentPropValue) = True Then '最小化按钮可用
ApplyProp False, , , WS_MINIMIZEBOX
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_MINIMIZEBOX
Else '最小化按钮不可用
ApplyProp False, , , , WS_MINIMIZEBOX
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_MINIMIZEBOX)
End If
Case 5
'是否可视
If CBool(CurrentPropValue) = True Then '可视
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_VISIBLE
Else
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_VISIBLE)
End If
Case 6
'有系统菜单
If CBool(CurrentPropValue) = True Then '有系统菜单
ApplyProp False, , , WS_SYSMENU
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_SYSMENU
Else '没有系统菜单
ApplyProp False, , , , WS_SYSMENU
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_SYSMENU)
End If
Case 7
'可调大小
If CBool(CurrentPropValue) = True Then '可调大小
ApplyProp False, , , WS_THICKFRAME
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_THICKFRAME
Else '不可调大小
ApplyProp False, , , , WS_THICKFRAME
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_THICKFRAME)
End If
Case 8
'初始状态
Select Case Me.comProp.ListIndex
Case 0 '普通
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not (WS_MAXIMIZE Or WS_MINIMIZE))
Case 1 '最小化
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_MINIMIZE
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_MAXIMIZE)
Case 2 '最大化
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_MAXIMIZE
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_MINIMIZE)
End Select
Case 9
'是否有效
If CBool(CurrentPropValue) = True Then '有效
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle And (Not WS_DISABLED)
Else '无效
frmTarget.CurrentWindowStyle = frmTarget.CurrentWindowStyle Or WS_DISABLED
End If
'===========================================================================
'图片控件属性列表不用管
'===========================================================================
'标签控件属性列表
Case 15
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
Case 16
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 17
'黑色填充
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , SS_BLACKRECT
Else '否
ApplyProp False, , , , SS_BLACKRECT
End If
Case 18
'文本位置
Select Case Me.comProp.ListIndex
Case 0 '左对齐
ApplyProp False, , , SS_LEFT, SS_CENTER Or SS_RIGHT
Case 1 '居中
ApplyProp False, , , SS_CENTER, SS_LEFT Or SS_RIGHT
Case 2 '右对齐
ApplyProp False, , , SS_RIGHT, SS_LEFT Or SS_CENTER
End Select
Case 19
'自动换行
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , SS_EDITCONTROL
Else '否
ApplyProp False, , , , SS_EDITCONTROL
End If
Case 20
'自动添加省略号
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , SS_ENDELLIPSIS
Else '否
ApplyProp False, , , , SS_ENDELLIPSIS
End If
'===========================================================================
'文本框控件属性列表
Case 24
'是否自动水平滚动
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_AUTOHSCROLL
Else '否
ApplyProp False, , , , ES_AUTOHSCROLL
End If
Case 25
'是否自动垂直滚动
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_AUTOVSCROLL
Else '否
ApplyProp False, , , , ES_AUTOVSCROLL
End If
Case 26
'文本位置
Select Case Me.comProp.ListIndex
Case 0 '左对齐
ApplyProp False, , , ES_LEFT, ES_CENTER Or ES_RIGHT
Case 1 '居中
ApplyProp False, , , ES_CENTER, ES_LEFT Or ES_RIGHT
Case 2 '右对齐
ApplyProp False, , , ES_RIGHT, ES_LEFT Or ES_CENTER
End Select
Case 27
'是否强制小写
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_LOWERCASE
Else '否
ApplyProp False, , , , ES_LOWERCASE
End If
Case 28
'是否强制大写
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_UPPERCASE
Else '否
ApplyProp False, , , , ES_UPPERCASE
End If
Case 29
'是否强制数字
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_NUMBER
Else '否
ApplyProp False, , , , ES_NUMBER
End If
Case 30
'是否是密码文本
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_PASSWORD
SendMessage CLng(Split(PropSetTarget.Tag, "|")(0)), EM_SETPASSWORDCHAR, CLng(MainPropList(PropSetTarget.Index, 9, 0)), 0
Else '否
ApplyProp False, , , , ES_PASSWORD
SendMessage CLng(Split(PropSetTarget.Tag, "|")(0)), EM_SETPASSWORDCHAR, 0, 0
End If
Case 32
'是否是只读文本
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_READONLY
Else '否
ApplyProp False, , , , ES_READONLY
End If
Case 33
'是否有黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 42
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 43
'多行
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_MULTILINE
Else '否
ApplyProp False, , , , ES_MULTILINE
End If
Case 44
'滚动条
Select Case Me.comProp.ListIndex
Case 0 '两个都没
ApplyProp False, , , 0, WS_HSCROLL Or WS_VSCROLL
Case 1 '水平
ApplyProp False, , , WS_HSCROLL, WS_VSCROLL
Case 2 '垂直
ApplyProp False, , , WS_VSCROLL, WS_HSCROLL
Case 3 '两个都有
ApplyProp False, , , WS_HSCROLL Or WS_VSCROLL, 0
End Select
Case 36
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
'===========================================================================
'组框属性列表
Case 38
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
'===========================================================================
'按钮属性列表
Case 46
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
Case 47
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 49
'扁平
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , BS_FLAT
Else '否
ApplyProp False, , , , BS_FLAT
End If
Case 50
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
'===========================================================================
'复选框属性列表
Case 54
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
Case 56
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 57
'扁平
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , BS_FLAT
Else '否
ApplyProp False, , , , BS_FLAT
End If
Case 58
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 59
'按钮形式
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , BS_PUSHLIKE
Else '否
ApplyProp False, , , , BS_PUSHLIKE
End If
'===========================================================================
'单选框属性列表
Case 63
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
Case 65
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 66
'扁平
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , BS_FLAT
Else '否
ApplyProp False, , , , BS_FLAT
End If
Case 67
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 68
'按钮形式
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , BS_PUSHLIKE
Else '否
ApplyProp False, , , , BS_PUSHLIKE
End If
'===========================================================================
'组合框属性列表
Case 72
'垂直滚动条
Select Case Me.comProp.ListIndex
Case 0 '无
ApplyProp False, , , 0, CBS_DISABLENOSCROLL Or WS_VSCROLL
Case 1 '自动
ApplyProp False, , , WS_VSCROLL, CBS_DISABLENOSCROLL
Case 2 '一直显示
ApplyProp False, , , CBS_DISABLENOSCROLL Or WS_VSCROLL, 0
End Select
Case 73
'自动水平滚动
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , CBS_AUTOHSCROLL
Else '否
ApplyProp False, , , , CBS_AUTOHSCROLL
End If
Case 74
'强制小写
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , CBS_LOWERCASE
Else '否
ApplyProp False, , , , CBS_LOWERCASE
End If
Case 75
'强制大写
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , CBS_UPPERCASE
Else '否
ApplyProp False, , , , CBS_UPPERCASE
End If
Case 76
'列表样式
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , CBS_SIMPLE, CBS_DROPDOWN
Else '否
ApplyProp False, , , CBS_DROPDOWN, CBS_SIMPLE
End If
Case 77
'自动排序
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , CBS_SORT
Else '否
ApplyProp False, , , , CBS_SORT
End If
'===========================================================================
'列表框属性列表
Case 82
'垂直滚动条
Select Case Me.comProp.ListIndex
Case 0 '无
ApplyProp False, , , 0, LBS_DISABLENOSCROLL Or WS_VSCROLL
Case 1 '自动
ApplyProp False, , , WS_VSCROLL, LBS_DISABLENOSCROLL
Case 2 '一直显示
ApplyProp False, , , LBS_DISABLENOSCROLL Or WS_VSCROLL, 0
End Select
Case 83
'允许多选
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , LBS_EXTENDEDSEL
Else '否
ApplyProp False, , , , LBS_EXTENDEDSEL
End If
Case 84
'是否多列
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , LBS_MULTICOLUMN
Else '否
ApplyProp False, , , , LBS_MULTICOLUMN
End If
Case 85
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 86
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 87
'自动排列
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , LBS_SORT
Else '否
ApplyProp False, , , , LBS_SORT
End If
'===========================================================================
'调节按钮属性列表
Case 109
'样式
Dim udTargetRect As RECT '目标调节按钮的大小
Dim NewHwnd As Long '新创建的控件的句柄
Dim udPrevCount As Long '控件之前的计数
NewHwnd = CLng(Split(PropSetTarget.Tag, "|")(0)) '需要删除的目标
udPrevCount = CLng(Split(PropSetTarget.Tag, "|")(2)) '获取控件之前的计数
GetWindowRect NewHwnd, udTargetRect '获取控件的大小
DestroyWindow NewHwnd '删掉容器里的控件
Select Case Me.comProp.ListIndex
Case 0 '垂直
NewHwnd = CreateWindowEx(0, "msctls_updown32", "", WS_VISIBLE Or WS_CHILD, _
0, 0, udTargetRect.Right - udTargetRect.Left, udTargetRect.Bottom - udTargetRect.Top, _
PropSetTarget.hWnd, 0, App.hInstance, 0)
Case 1 '水平
NewHwnd = CreateWindowEx(0, "msctls_updown32", "", WS_VISIBLE Or WS_CHILD Or UDS_HORZ, _
0, 0, udTargetRect.Right - udTargetRect.Left, udTargetRect.Bottom - udTargetRect.Top, _
PropSetTarget.hWnd, 0, App.hInstance, 0)
End Select
SetWindowPos NewHwnd, 0, udTargetRect.Left, udTargetRect.Top, _
udTargetRect.Right - udTargetRect.Left, udTargetRect.Bottom - udTargetRect.Top, 0
PropSetTarget.Tag = NewHwnd & "|11|" & udPrevCount
'===========================================================================
'进度条属性列表
Case 113, 114
'最小值 & 最大值
If Me.labPropValue(1).Caption = "" Then
Me.labPropValue(1).Caption = "0"
MainPropList(PropSetTarget.Index, 1, 0) = "0"
End If
If Me.labPropValue(2).Caption = "" Then
Me.labPropValue(2).Caption = "0"
MainPropList(PropSetTarget.Index, 2, 0) = "0"
End If
'发送更改进度条范围的消息
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), PBM_SETRANGE32, _
CLng(Me.labPropValue(1).Caption), CLng(Me.labPropValue(2).Caption)
Case 115
'样式
If Me.comProp.ListIndex = 0 Then '方块
ApplyProp False, , , , PBS_SMOOTH
Else '平滑
ApplyProp False, , , PBS_SMOOTH
End If
Case 116
'方向
If Me.comProp.ListIndex = 0 Then '水平
ApplyProp False, , , , PBS_VERTICAL
Else '垂直
ApplyProp False, , , PBS_VERTICAL
End If
Case 117
'滑块颜色
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), PBM_SETBARCOLOR, 0, CLng(CurrentPropValue)
Case 118
'背景颜色
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), PBM_SETBKCOLOR, 0, CLng(CurrentPropValue)
'===========================================================================
'滑块属性列表
Case 122
'方向
If Me.comProp.ListIndex = 0 Then '水平
ApplyProp False, , , , TBS_VERT
Else '垂直
ApplyProp False, , , TBS_VERT
End If
Case 123
'刻度位置
'先去掉所有的刻度样式
ApplyProp False, , , , TBS_LEFT Or TBS_TOP Or TBS_BOTTOM Or TBS_RIGHT Or TBS_BOTH Or TBS_NOTICKS
Select Case Me.comProp.ListIndex
Case 0 '左边
ApplyProp False, , , TBS_LEFT
Case 1 '右边
ApplyProp False, , , TBS_RIGHT
Case 2 '上方
ApplyProp False, , , TBS_TOP
Case 3 '下方
ApplyProp False, , , TBS_BOTTOM
Case 4 '都有
ApplyProp False, , , TBS_BOTH
Case 5 '无刻度
ApplyProp False, , , TBS_NOTICKS
End Select
Case 124
'不显示滑块
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , TBS_NOTHUMB
Else '否
ApplyProp False, , , , TBS_NOTHUMB
End If
Case 126
'刻度间隔
If Me.labPropValue(5).Caption = "" Then
Me.labPropValue(5).Caption = "0"
MainPropList(PropSetTarget.Index, 5, 0) = "0"
End If
SendMessage CLng(Split(PropSetTarget.Tag, "|")(0)), TBM_SETTICFREQ, _
CLng(Me.labPropValue(5).Caption), 0
Case 127
'最小值
If Me.labPropValue(6).Caption = "" Then
Me.labPropValue(6).Caption = "0"
MainPropList(PropSetTarget.Index, 6, 0) = "0"
End If
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), TBM_SETRANGEMIN, _
0, CLng(Me.labPropValue(6).Caption)
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), TBM_SETPOS, 0, 0 '让滑块移到0的位置
Case 128
'最大值
If Me.labPropValue(7).Caption = "" Then
Me.labPropValue(7).Caption = "0"
MainPropList(PropSetTarget.Index, 7, 0) = "0"
End If
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), TBM_SETRANGEMAX, _
0, CLng(Me.labPropValue(7).Caption)
PostMessage CLng(Split(PropSetTarget.Tag, "|")(0)), TBM_SETPOS, 0, 0 '让滑块移到0的位置
Case 131
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
'===========================================================================
'列表视图属性列表
Case 138
'样式
'先去掉所有的样式
ApplyProp False, , , , LVS_ICON Or LVS_REPORT Or LVS_SMALLICON Or LVS_LIST
Select Case Me.comProp.ListIndex
Case 0 '图标
ApplyProp False, , , LVS_ICON
Case 1 '列表
ApplyProp False, , , LVS_LIST
Case 2 '报告
ApplyProp False, , , LVS_REPORT
Case 3 '小图标
ApplyProp False, , , LVS_SMALLICON
End Select
Case 143
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
'===========================================================================
'树视图属性列表
Case 156
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
'===========================================================================
'动画控件属性表
Case 177
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 178
'黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
'===========================================================================
'RTF文本框属性表
Case 182
'文本
SetWindowText Split(PropSetTarget.Tag, "|")(0), CurrentPropValue
Case 183
'是否自动水平滚动
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_AUTOHSCROLL
Else '否
ApplyProp False, , , , ES_AUTOHSCROLL
End If
Case 184
'是否自动垂直滚动
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_AUTOVSCROLL
Else '否
ApplyProp False, , , , ES_AUTOVSCROLL
End If
Case 185
'文本位置
Select Case Me.comProp.ListIndex
Case 0 '左对齐
ApplyProp False, , , ES_LEFT, ES_CENTER Or ES_RIGHT
Case 1 '居中
ApplyProp False, , , ES_CENTER, ES_LEFT Or ES_RIGHT
Case 2 '右对齐
ApplyProp False, , , ES_RIGHT, ES_LEFT Or ES_CENTER
End Select
Case 186
'是否强制数字
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_NUMBER
Else '否
ApplyProp False, , , , ES_NUMBER
End If
Case 187
'是否是密码文本
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_PASSWORD
Else '否
ApplyProp False, , , , ES_PASSWORD
End If
Case 188
'是否是只读文本
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_READONLY
Else '否
ApplyProp False, , , , ES_READONLY
End If
Case 189
'是否有黑色边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , WS_BORDER
Else '否
ApplyProp False, , , , WS_BORDER
End If
Case 190
'立体边框
If CBool(CurrentPropValue) = True Then '是
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, WS_EX_CLIENTEDGE
Else '否
SetWindowLong Split(PropSetTarget.Tag, "|")(0), GWL_EXSTYLE, 0
End If
Case 191
'下沉的边框
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_SUNKEN
Else '否
ApplyProp False, , , , ES_SUNKEN
End If
Case 192
'多行文本
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_MULTILINE
Else '否
ApplyProp False, , , , ES_MULTILINE
End If
Case 193
'滚动条
Select Case Me.comProp.ListIndex
Case 0 '两个都没
ApplyProp False, , , 0, WS_HSCROLL Or WS_VSCROLL
Case 1 '水平
ApplyProp False, , , WS_HSCROLL, WS_VSCROLL
Case 2 '垂直
ApplyProp False, , , WS_VSCROLL, WS_HSCROLL
Case 3 '两个都有
ApplyProp False, , , WS_HSCROLL Or WS_VSCROLL, 0
End Select
Case 194
'滚动条自动禁用
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_DISABLENOSCROLL
Else '否
ApplyProp False, , , , ES_DISABLENOSCROLL
End If
Case 195
'禁用输入法
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_NOIME
Else '否
ApplyProp False, , , , ES_NOIME
End If
Case 196
'左边缘空白
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , ES_SELECTIONBAR
Else '否
ApplyProp False, , , , ES_SELECTIONBAR
End If
'===========================================================================
'日期时间选择器属性表
Case 200
'完整日期格式
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , DTS_LONGDATEFORMAT
Else '否
ApplyProp False, , , , DTS_LONGDATEFORMAT
End If
Case 201
'日历在右边弹出
If CBool(CurrentPropValue) = True Then '是
ApplyProp False, , , DTS_RIGHTALIGN
Else '否
ApplyProp False, , , , DTS_RIGHTALIGN
End If