-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathShapeEx.ctl
More file actions
2964 lines (2629 loc) · 119 KB
/
ShapeEx.ctl
File metadata and controls
2964 lines (2629 loc) · 119 KB
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
Begin VB.UserControl ShapeEx
BackStyle = 0 'Transparent
ClientHeight = 2880
ClientLeft = 0
ClientTop = 0
ClientWidth = 3840
ClipBehavior = 0 'None
HasDC = 0 'False
ScaleHeight = 192
ScaleMode = 3 'Pixel
ScaleWidth = 256
ToolboxBitmap = "ShapeEx.ctx":0000
Windowless = -1 'True
Begin VB.Timer tmrPainting
Enabled = 0 'False
Interval = 1
Left = 144
Top = 108
End
End
Attribute VB_Name = "ShapeEx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'--- for MST subclassing (1)
#Const ImplNoIdeProtection = (MST_NO_IDE_PROTECTION <> 0)
Private Const MEM_COMMIT As Long = &H1000
Private Const PAGE_EXECUTE_READWRITE As Long = &H40
Private Const CRYPT_STRING_BASE64 As Long = 1
Private Declare Function VirtualAlloc Lib "kernel32" (ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
Private Declare Function CryptStringToBinary Lib "crypt32" Alias "CryptStringToBinaryA" (ByVal pszString As String, ByVal cchString As Long, ByVal dwFlags As Long, ByVal pbBinary As Long, pcbBinary As Long, Optional ByVal pdwSkip As Long, Optional ByVal pdwFlags As Long) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function GetProcAddressByOrdinal Lib "kernel32" Alias "GetProcAddress" (ByVal hModule As Long, ByVal lpProcOrdinal As Long) As Long
Private Declare Function DefSubclassProc Lib "comctl32" Alias "#413" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function GetProp Lib "user32" Alias "GetPropA" (ByVal hWnd As Long, ByVal lpString As String) As Long
Private Declare Function SetProp Lib "user32" Alias "SetPropA" (ByVal hWnd As Long, ByVal lpString As String, ByVal hData As Long) As Long
#If Not ImplNoIdeProtection Then
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
#End If
Private m_pSubclass As IUnknown
'--- End for MST subclassing (1)
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type T_MSG
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As T_MSG, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Const PM_REMOVE = &H1
Private Type XFORM
eM11 As Single
eM12 As Single
eM21 As Single
eM22 As Single
eDx As Single
eDy As Single
End Type
Private Declare Function SetGraphicsMode Lib "gdi32" (ByVal hDC As Long, ByVal iMode As Long) As Long
Private Declare Function SetWorldTransform Lib "gdi32" (ByVal hDC As Long, lpXform As XFORM) As Long
Private Declare Function ModifyWorldTransform Lib "gdi32" (ByVal hDC As Long, lpXform As XFORM, ByVal iMode As Long) As Long
Private Const MWT_IDENTITY = 1
Private Const MWT_LEFTMULTIPLY = 2
'Private Const MWT_RIGHTMULTIPLY = 3
Private Const GM_ADVANCED = 2
'Private Const GM_COMPATIBLE = 1
Private Const Pi = 3.14159265358979
Private Const WM_USER As Long = &H400
Private Const WM_INVALIDATE As Long = WM_USER + 11 ' custom message
Private Declare Function GetClipRgn Lib "gdi32" (ByVal hDC As Long, ByVal hRgn As Long) As Long
Private Declare Function GetRgnBox Lib "gdi32" (ByVal hRgn As Long, lpRect As RECT) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function SelectClipRgn Lib "gdi32" (ByVal hDC As Long, ByVal hRgn As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function InvalidateRectAsNull Lib "user32" Alias "InvalidateRect" (ByVal hWnd As Long, ByVal lpRect As Long, ByVal bErase As Long) As Long
'Private Declare Function GetUpdateRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT, ByVal bErase As Long) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function OleTranslateColor Lib "OleAut32.dll" (ByVal lOleColor As Long, ByVal lHPalette As Long, ByVal lColorRef As Long) As Long
Private Declare Function InflateRect Lib "user32" (lpRect As RECT, ByVal X As Long, ByVal Y As Long) As Long
Private Type RECT
Left As Long
top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTL
X As Long
Y As Long
End Type
Private Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal hDC As Long, ByRef graphics As Long) As Long
Private Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As Long
Private Declare Function GdiplusStartup Lib "gdiplus" (hToken As Long, pInputBuf As Any, Optional ByVal pOutputBuf As Long = 0) As Long
Private Declare Function GdiplusShutdown Lib "gdiplus" (ByVal token As Long) As Long
Private Declare Function GdipSetSmoothingMode Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mSmoothingMode As Long) As Long
Private Declare Function GdipDeleteBrush Lib "GdiPlus.dll" (ByVal mBrush As Long) As Long
Private Declare Function GdipCreateSolidFill Lib "GdiPlus.dll" (ByVal mColor As Long, ByRef mBrush As Long) As Long
Private Declare Function GdipFillEllipseI Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mBrush As Long, ByVal mX As Long, ByVal mY As Long, ByVal mWidth As Long, ByVal mHeight As Long) As Long
Private Declare Function GdipFillRectangleI Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mBrush As Long, ByVal mX As Long, ByVal mY As Long, ByVal mWidth As Long, ByVal mHeight As Long) As Long
Private Declare Function GdipDrawEllipseI Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mPen As Long, ByVal mX As Long, ByVal mY As Long, ByVal mWidth As Long, ByVal mHeight As Long) As Long
Private Declare Function GdipCreatePen1 Lib "gdiplus" (ByVal color As Long, ByVal Width As Single, ByVal unit As Long, pen As Long) As Long
Private Declare Function GdipDeletePen Lib "GdiPlus.dll" (ByVal mPen As Long) As Long
Private Declare Function GdipDrawArcI Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single, ByVal sweepAngle As Single) As Long
Private Declare Function GdipDrawLineI Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
Private Declare Function GdipFillPieI Lib "gdiplus" (ByVal graphics As Long, ByVal Brush As Long, ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single, ByVal sweepAngle As Single) As Long
Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, Col As Long) As Long
Private Declare Function GdipDrawPolygonI Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByRef pPoints As Any, ByVal Count As Long) As Long
Private Declare Function GdipFillPolygonI Lib "gdiplus" (ByVal graphics As Long, ByVal Brush As Long, ByRef pPoints As Any, ByVal Count As Long, ByVal FillMode As Long) As Long
Private Declare Function GdipDrawClosedCurve2I Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, Points As Any, ByVal Count As Long, ByVal tension As Single) As Long
Private Declare Function GdipFillClosedCurve2I Lib "gdiplus" (ByVal graphics As Long, ByVal Brush As Long, Points As Any, ByVal Count As Long, ByVal tension As Single, ByVal FillMode As Long) As Long
Private Declare Function GdipSetPenDashStyle Lib "gdiplus" (ByVal pen As Long, ByVal dStyle As Long) As Long
Private Declare Function GdipCreatePath Lib "GdiPlus.dll" (ByVal mBrushMode As Long, ByRef mPath As Long) As Long
Private Declare Function GdipAddPathEllipseI Lib "GdiPlus.dll" (ByVal mPath As Long, ByVal mX As Long, ByVal mY As Long, ByVal mWidth As Long, ByVal mHeight As Long) As Long
Private Declare Function GdipDeletePath Lib "GdiPlus.dll" (ByVal mPath As Long) As Long
Private Declare Function GdipSetPathGradientCenterColor Lib "GdiPlus.dll" (ByVal mBrush As Long, ByVal mColors As Long) As Long
Private Declare Function GdipSetPathGradientSurroundColorsWithCount Lib "GdiPlus.dll" (ByVal mBrush As Long, ByRef mColor As Long, ByRef mCount As Long) As Long
Private Declare Function GdipCreatePathGradientFromPath Lib "GdiPlus.dll" (ByVal mPath As Long, ByRef mPolyGradient As Long) As Long
Private Declare Function GdipCreatePathGradientI Lib "gdiplus" (Points As POINTL, ByVal Count As Long, ByVal WrapMd As Long, polyGradient As Long) As Long
Private Declare Function GdipAddPathArcI Lib "GdiPlus.dll" (ByVal mPath As Long, ByVal mX As Long, ByVal mY As Long, ByVal mWidth As Long, ByVal mHeight As Long, ByVal mStartAngle As Single, ByVal mSweepAngle As Single) As Long
Private Declare Function GdipClosePathFigure Lib "GdiPlus.dll" (ByVal mPath As Long) As Long
Private Declare Function GdipDrawPath Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mPen As Long, ByVal mPath As Long) As Long
Private Declare Function GdipFillPath Lib "GdiPlus.dll" (ByVal mGraphics As Long, ByVal mBrush As Long, ByVal mPath As Long) As Long
Private Declare Function GdipDrawPieI Lib "gdiplus" (ByVal graphics As Long, ByVal pen As Long, ByVal X As Long, ByVal Y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single, ByVal sweepAngle As Single) As Long
Private Enum FillModeConstants
FillModeAlternate = &H0
FillModeWinding = &H1
End Enum
Private Const UnitPixel = 2
Private Const QualityModeLow As Long = 1
Private Const SmoothingModeAntiAlias As Long = &H4
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Event Click()
Attribute Click.VB_UserMemId = -600
Attribute Click.VB_MemberFlags = "200"
Event DblClick()
Attribute DblClick.VB_UserMemId = -601
Event MouseDown(Button As Integer, shift As Integer, X As Single, Y As Single)
Attribute MouseDown.VB_UserMemId = -605
Event MouseMove(Button As Integer, shift As Integer, X As Single, Y As Single)
Attribute MouseMove.VB_UserMemId = -606
Event MouseUp(Button As Integer, shift As Integer, X As Single, Y As Single)
Attribute MouseUp.VB_UserMemId = -604
Public Enum SEShapeConstants
seShapeRectangle = vbShapeRectangle ' 0
seShapeSquare = vbShapeSquare ' 1
seShapeOval = vbShapeOval ' 2
seShapeCircle = vbShapeCircle ' 3
seShapeRoundedRectangle = vbShapeRoundedRectangle ' 4
seShapeRoundedSquare = vbShapeRoundedSquare ' 5
seShapeTriangleEquilateral = 6
seShapeTriangleIsosceles = 7
seShapeTriangleScalene = 8
seShapeTriangleRight = 9
seShapeRhombus = 10
seShapeKite = 11
seShapeDiamond = 12
seShapeTrapezoid = 13
seShapeParalellogram = 14
seShapeSemicircle = 15
seShapeRegularPolygon = 16
seShapeStar = 17
seShapeJaggedStar = 18
seShapeHeart = 19
seShapeArrow = 20
seShapeCrescent = 21
seShapeDrop = 22
seShapeEgg = 23
seShapeLocation = 24
seShapeSpeaker = 25
seShapeCloud = 26
seShapeTalk = 27
seShapeShield = 28
seShapePie = 29
End Enum
Public Enum SEBackStyleConstants
seTransparent = 0
seOpaque = 1
End Enum
Public Enum SEFillStyle2Constants
seFSSolid = vbFSSolid
seFSTransparent = vbFSTransparent
End Enum
Public Enum SEQualityConstants
seQualityLow = 0
seQualityHigh = 1
End Enum
Public Enum SEStyle3DConstants
seStyle3DNone = 0
seStyle3DLight = 1
seStyle3DShadow = 2
seStyle3DBoth = 3
End Enum
Public Enum SEStyle3DEffectConstants
seStyle3EffectAuto = 0
seStyle3EffectDiffuse = 1
seStyle3EffectGem = 2
End Enum
Public Enum SEFlippedConstants
seFlippedNo = 0
seFlippedHorizontally = 1
seFlippedVertically = 2
seFlippedBoth = 3
End Enum
Public Enum SESubclassingConstants
seSCNo = 0 ' never ' In most cases subclassing is not necessary (and without subclassing is safer for running in the IDE), but in some special cases when the figure needs to be painted outside the control bounds, it may experience glitches.
seSCYes = 1 ' always
seSCNotInIDE = 2 ' compiled will use subclassing
seSCNotInIDEDesignTime = 3 ' IDE run time and compiled will use subclassing
End Enum
' Property defaults
Private Const mdef_BackColor = vbWindowBackground
Private Const mdef_BackStyle = seTransparent
Private Const mdef_BorderColor = vbWindowText
Private Const mdef_Shape = seShapeRectangle
Private Const mdef_FillColor = vbBlack
Private Const mdef_FillStyle = vbFSTransparent
Private Const mdef_BorderStyle = vbBSSolid
Private Const mdef_BorderWidth = 1
Private Const mdef_Clickable = True
Private Const mdef_Quality = seQualityHigh
Private Const mdef_RotationDegrees = 0
Private Const mdef_Opacity = 100
Private Const mdef_Shift = 0
Private Const mdef_Vertices = 5
Private Const mdef_CurvingFactor = 0
Private Const mdef_Flipped = seFlippedNo
Private Const mdef_MousePointer = vbDefault
Private Const mdef_Style3D = seStyle3DNone
Private Const mdef_Style3DEffect = seStyle3EffectAuto
Private Const mdef_UseSubclassing = seSCNotInIDEDesignTime ' seSCYes
' Properties
Private mBackColor As Long
Private mBackStyle As SEBackStyleConstants
Private mBorderColor As Long
Private mShape As SEShapeConstants
Private mFillColor As Long
Private mFillStyle As Long
Private mBorderStyle As BorderStyleConstants
Private mBorderWidth As Integer
Private mClickable As Boolean
Private mQuality As SEQualityConstants
Private mRotationDegrees As Single
Private mOpacity As Single
Private mShift As Single
Private mVertices As Integer
Private mCurvingFactor As Integer
Private mFlipped As SEFlippedConstants
Private mMousePointer As Integer
Private mMouseIcon As StdPicture
Private mStyle3D As SEStyle3DConstants
Private mStyle3DEffect As SEStyle3DEffectConstants
Private mUseSubclassing As SESubclassingConstants
Private mAttached As Boolean
Private mShiftPutAutomatically As Single
Private mCurvingFactor2 As Single
Private mUserMode As Boolean
Private mSubclassed As Boolean
Private mDrawingOutsideUC As Boolean
Property Get enabled() As Boolean
enabled = UserControl.enabled
End Property
Property Let enabled(ByVal bValue As Boolean)
If UserControl.enabled <> bValue Then
UserControl.enabled = bValue
End If
PropertyChanged
End Property
Private Sub tmrPainting_Timer()
tmrPainting.enabled = False
End Sub
Private Sub UserControl_AmbientChanged(PropertyName As String)
If PropertyName = "UserMode" Then mUserMode = Ambient.UserMode
End Sub
Private Sub UserControl_Click()
RaiseEvent Click
End Sub
Private Sub UserControl_DblClick()
RaiseEvent DblClick
End Sub
Private Sub UserControl_HitTest(X As Single, Y As Single, HitResult As Integer)
If mUserMode Then
If mClickable Then
HitResult = vbHitResultHit
End If
Else
HitResult = vbHitResultHit
End If
End Sub
Private Sub UserControl_InitProperties()
mBackColor = mdef_BackColor
mBackStyle = mdef_BackStyle
mBorderColor = mdef_BorderColor
mShape = mdef_Shape
mFillColor = mdef_FillColor
mFillStyle = mdef_FillStyle
mBorderStyle = mdef_BorderStyle
mBorderWidth = mdef_BorderWidth
mClickable = mdef_Clickable
mQuality = mdef_Quality
mRotationDegrees = mdef_RotationDegrees
mOpacity = mdef_Opacity
mShift = mdef_Shift
mVertices = mdef_Vertices
mCurvingFactor = mdef_CurvingFactor
mFlipped = mdef_Flipped
mMousePointer = mdef_MousePointer
Set mMouseIcon = Nothing
mStyle3D = mdef_Style3D
mStyle3DEffect = mdef_Style3DEffect
mUseSubclassing = mdef_UseSubclassing
On Error Resume Next
mUserMode = Ambient.UserMode
On Error GoTo 0
SetCurvingFactor2
pvSubclass
End Sub
Private Sub UserControl_KeyPress(KeyAscii As Integer)
If mClickable Then
If (KeyAscii = vbKeySpace) Then
UserControl_Click
End If
End If
End Sub
Private Sub UserControl_MouseDown(Button As Integer, shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, shift, X, Y)
End Sub
Private Sub UserControl_MouseMove(Button As Integer, shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, shift, X, Y)
End Sub
Private Sub UserControl_MouseUp(Button As Integer, shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, shift, X, Y)
End Sub
Private Sub UserControl_Paint()
Dim hRgn As Long
Dim rgnRect As RECT
Dim hRgnExpand As Long
Dim iExpandForPen As Long
Dim iGMPrev As Long
Dim mtx1 As XFORM, mtx2 As XFORM, c As Single, s As Single
Dim iExpandOutsideForAngle As Long
Dim iExpandOutsideForFigure As Long
Dim iExpandOutsideForCurve As Long
Dim iLng As Long
Dim iLng2 As Long
Dim iShift As Long
Static sTheLastTimeWasExpanded As Boolean
Dim iAuxExpand As Long
If (mRotationDegrees > 0) Or (mFlipped <> seFlippedNo) Then
iGMPrev = SetGraphicsMode(UserControl.hDC, GM_ADVANCED)
ModifyWorldTransform UserControl.hDC, mtx1, MWT_IDENTITY
If mRotationDegrees = 0 Then
c = 1
s = 0
Else
c = Cos(-mRotationDegrees / 360 * 2 * Pi)
s = Sin(-mRotationDegrees / 360 * 2 * Pi)
End If
mtx1.eM11 = c: mtx1.eM12 = s: mtx1.eM21 = -s: mtx1.eM22 = c: mtx1.eDx = (UserControl.ScaleWidth - 1) / 2: mtx1.eDy = (UserControl.ScaleHeight - 1) / 2
If mFlipped = seFlippedHorizontally Then
mtx2.eM11 = -1: mtx2.eM22 = 1: mtx2.eDx = (UserControl.ScaleWidth - 1) / 2: mtx2.eDy = -(UserControl.ScaleHeight - 1) / 2
ElseIf mFlipped = seFlippedVertically Then
mtx2.eM11 = 1: mtx2.eM22 = -1: mtx2.eDx = -(UserControl.ScaleWidth - 1) / 2: mtx2.eDy = (UserControl.ScaleHeight - 1) / 2
ElseIf mFlipped = seFlippedBoth Then
mtx2.eM11 = -1: mtx2.eM22 = -1: mtx2.eDx = (UserControl.ScaleWidth - 1) / 2: mtx2.eDy = (UserControl.ScaleHeight - 1) / 2
Else
mtx2.eM11 = 1: mtx2.eM22 = 1: mtx2.eDx = -(UserControl.ScaleWidth - 1) / 2: mtx2.eDy = -(UserControl.ScaleHeight - 1) / 2
End If
End If
iExpandForPen = mBorderWidth / 2
If mCurvingFactor > 0 Then
iAuxExpand = UserControl.ScaleWidth / UserControl.ScaleHeight * (1 + mCurvingFactor / 10)
If iAuxExpand > iExpandForPen Then
iExpandForPen = iAuxExpand
End If
End If
If (mShape > seShapeRoundedSquare) Then
If UserControl.ScaleWidth > UserControl.ScaleHeight Then
iAuxExpand = UserControl.ScaleWidth / UserControl.ScaleHeight * mBorderWidth
Else
iAuxExpand = UserControl.ScaleHeight / UserControl.ScaleWidth * mBorderWidth
End If
If (mShape = seShapeStar) Or (mShape = seShapeJaggedStar) Then
iExpandForPen = iExpandForPen * mVertices / 6
End If
If iAuxExpand > iExpandForPen Then
iExpandForPen = iAuxExpand
End If
End If
If ShapeHasShift(mShape) Then
If UserControl.ScaleWidth > UserControl.ScaleHeight Then
iShift = mShift * UserControl.ScaleWidth / 100
Else
iShift = mShift * UserControl.ScaleHeight / 100
End If
iLng = UserControl.ScaleWidth / 2 - iShift * 1.3
If iLng < 0 Then
iExpandOutsideForFigure = Abs(iLng)
Else
iLng = UserControl.ScaleWidth / 2 + iShift - UserControl.ScaleWidth
If iLng > 0 Then
iExpandOutsideForFigure = iLng
Else
iLng = UserControl.ScaleWidth / 2 + iShift
If iLng < 0 Then
iExpandOutsideForFigure = Abs(iLng)
End If
If iExpandOutsideForFigure < Abs(iShift) Then
iExpandOutsideForFigure = Abs(iShift)
End If
End If
End If
End If
If mCurvingFactor <> 0 Then
iExpandOutsideForCurve = (UserControl.Width ^ 2 + UserControl.Height ^ 2) ^ 0.5 * 1.2
End If
If (mRotationDegrees <> 0) Then
If (mShape <> seShapeCircle) And (mShape <> seShapeStar) And (mShape <> seShapeJaggedStar) Then
iLng = Abs((UserControl.Width - UserControl.Height) / 2)
iLng2 = (UserControl.Width ^ 2 + UserControl.Height ^ 2) ^ 0.5
If iLng < iLng2 Then
iExpandOutsideForAngle = iLng
Else
iExpandOutsideForAngle = iLng2
End If
End If
End If
mDrawingOutsideUC = False
hRgn = CreateRectRgn(0, 0, 0, 0)
If GetClipRgn(UserControl.hDC, hRgn) = 0& Then ' hDc is one passed to Paint
DeleteObject hRgn: hRgn = 0
Else
GetRgnBox hRgn, rgnRect ' get its bounds & adjust our region accordingly (i.e.,expand 1 pixel)
'Debug.Print "Rect: "; rgnRect.Left, rgnRect.Top, rgnRect.Right, rgnRect.Bottom
If (iExpandForPen <> 0) Or (iExpandOutsideForAngle <> 0) Or (iExpandOutsideForFigure <> 0) Or sTheLastTimeWasExpanded Then
hRgnExpand = CreateRectRgn(rgnRect.Left - iExpandForPen - iExpandOutsideForAngle - iExpandOutsideForFigure, rgnRect.top - iExpandForPen - iExpandOutsideForAngle - iExpandOutsideForFigure, rgnRect.Right + iExpandForPen + iExpandOutsideForAngle + iExpandOutsideForFigure, rgnRect.Bottom + iExpandForPen + iExpandOutsideForAngle + iExpandOutsideForFigure)
SelectClipRgn UserControl.hDC, hRgnExpand
DeleteObject hRgnExpand
If Not tmrPainting.enabled Then
If (UserControl.ContainerHwnd <> 0) And mSubclassed Then
PostMessage UserControl.ContainerHwnd, WM_INVALIDATE, 0&, 0&
End If
End If
mDrawingOutsideUC = True
End If
End If
sTheLastTimeWasExpanded = (iExpandForPen <> 0) Or (iExpandOutsideForAngle <> 0) Or (iExpandOutsideForFigure <> 0)
tmrPainting.enabled = False
tmrPainting.enabled = True
If (mRotationDegrees > 0) Or (mFlipped <> seFlippedNo) Then
SetWorldTransform UserControl.hDC, mtx1
ModifyWorldTransform UserControl.hDC, mtx2, MWT_LEFTMULTIPLY
End If
Draw
If hRgnExpand <> 0 Then SelectClipRgn UserControl.hDC, hRgn ' restore original clip region
If hRgn <> 0 Then DeleteObject hRgn
If (mRotationDegrees > 0) Or (mFlipped <> seFlippedNo) Then
SetGraphicsMode UserControl.hDC, iGMPrev
End If
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
mBackColor = PropBag.ReadProperty("BackColor", mdef_BackColor)
mBackStyle = PropBag.ReadProperty("BackStyle", mdef_BackStyle)
mBorderColor = PropBag.ReadProperty("BorderColor", mdef_BorderColor)
mShape = PropBag.ReadProperty("Shape", mdef_Shape)
mFillColor = PropBag.ReadProperty("FillColor", mdef_FillColor)
mFillStyle = PropBag.ReadProperty("FillStyle", mdef_FillStyle)
mBorderStyle = PropBag.ReadProperty("BorderStyle", mdef_BorderStyle)
mBorderWidth = PropBag.ReadProperty("BorderWidth", mdef_BorderWidth)
mClickable = PropBag.ReadProperty("Clickable", mdef_Clickable)
mQuality = PropBag.ReadProperty("Quality", mdef_Quality)
mRotationDegrees = PropBag.ReadProperty("RotationDegrees", mdef_RotationDegrees)
mOpacity = PropBag.ReadProperty("Opacity", mdef_Opacity)
mShift = PropBag.ReadProperty("Shift", mdef_Shift)
mShiftPutAutomatically = PropBag.ReadProperty("ShiftPutAutomatically", 0)
mVertices = PropBag.ReadProperty("Vertices", mdef_Vertices)
mCurvingFactor = PropBag.ReadProperty("CurvingFactor", mdef_CurvingFactor)
mFlipped = PropBag.ReadProperty("Flipped", mdef_Flipped)
mMousePointer = PropBag.ReadProperty("MousePointer", mdef_MousePointer)
Set mMouseIcon = PropBag.ReadProperty("MouseIcon", Nothing)
mStyle3D = PropBag.ReadProperty("Style3D", mdef_Style3D)
mStyle3DEffect = PropBag.ReadProperty("Style3DEffect", mdef_Style3DEffect)
mUseSubclassing = PropBag.ReadProperty("UseSubclassing", mdef_UseSubclassing)
UserControl.MousePointer = mMousePointer
Set UserControl.MouseIcon = mMouseIcon
On Error Resume Next
mUserMode = Ambient.UserMode
On Error GoTo 0
SetCurvingFactor2
pvSubclass
End Sub
Private Sub UserControl_Terminate()
pvUnsubclass
On Error Resume Next
If (mBorderWidth > 1) Or (mRotationDegrees > 0) Then InvalidateRectAsNull UserControl.ContainerHwnd, 0&, 1& ' paint the container when the control is deleted if the BorderWidth is greater than 1 or the control is rotated (if it painted outside its bounds)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "BackColor", mBackColor, mdef_BackColor
PropBag.WriteProperty "BackStyle", mBackStyle, mdef_BackStyle
PropBag.WriteProperty "BorderColor", mBorderColor, mdef_BorderColor
PropBag.WriteProperty "Shape", mShape, mdef_Shape
PropBag.WriteProperty "FillColor", mFillColor, mdef_FillColor
PropBag.WriteProperty "FillStyle", mFillStyle, mdef_FillStyle
PropBag.WriteProperty "BorderStyle", mBorderStyle, mdef_BorderStyle
PropBag.WriteProperty "BorderWidth", mBorderWidth, mdef_BorderWidth
PropBag.WriteProperty "Clickable", mClickable, mdef_Clickable
PropBag.WriteProperty "Quality", mQuality, mdef_Quality
PropBag.WriteProperty "RotationDegrees", mRotationDegrees, mdef_RotationDegrees
PropBag.WriteProperty "Opacity", mOpacity, mdef_Opacity
PropBag.WriteProperty "Shift", mShift, mdef_Shift
PropBag.WriteProperty "ShiftPutAutomatically", mShiftPutAutomatically, 0
PropBag.WriteProperty "Vertices", mVertices, mdef_Vertices
PropBag.WriteProperty "CurvingFactor", mCurvingFactor, mdef_CurvingFactor
PropBag.WriteProperty "Flipped", mFlipped, mdef_Flipped
PropBag.WriteProperty "MousePointer", mMousePointer, mdef_MousePointer
PropBag.WriteProperty "MouseIcon", mMouseIcon, Nothing
PropBag.WriteProperty "Style3D", mStyle3D, mdef_Style3D
PropBag.WriteProperty "Style3DEffect", mStyle3DEffect, mdef_Style3DEffect
PropBag.WriteProperty "UseSubclassing", mUseSubclassing, mdef_UseSubclassing
End Sub
Public Property Get BorderColor() As OLE_COLOR
Attribute BorderColor.VB_Description = "Returns/sets the color of an object's border."
Attribute BorderColor.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute BorderColor.VB_UserMemId = -503
BorderColor = M2000color(mBorderColor)
End Property
Public Property Let BorderColor(ByVal nValue As OLE_COLOR)
If nValue <> mBorderColor Then
mBorderColor = mycolor(nValue)
Me.Refresh
PropertyChanged "BorderColor"
End If
End Property
Public Property Get Shape() As SEShapeConstants
Attribute Shape.VB_Description = "Returns/sets a value indicating the appearance of a control."
Attribute Shape.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Shape = mShape
End Property
Public Property Let Shape(ByVal nValue As SEShapeConstants)
If nValue <> mShape Then
If (nValue < seShapeRectangle) Or (nValue > seShapePie) Then Err.Raise 380, Typename(Me): Exit Property
If ShapeHasShift(mShape) Then
If mShift = mShiftPutAutomatically Then
mShift = 0
mShiftPutAutomatically = 0
End If
End If
mShape = nValue
If ShapeHasShift(mShape) Then
If mShift = 0 Then
mShift = 20
mShiftPutAutomatically = mShift
End If
End If
Me.Refresh
PropertyChanged "Shape"
End If
End Property
Private Function ShapeHasShift(nShape As SEShapeConstants) As Boolean
Select Case nShape
Case seShapeTriangleScalene, seShapeKite, seShapeDiamond, seShapeTrapezoid, seShapeParalellogram, seShapeArrow, seShapeStar, seShapeJaggedStar, seShapeTalk, seShapeCrescent
ShapeHasShift = True
End Select
End Function
Public Property Get BackColor() As OLE_COLOR
Attribute BackColor.VB_Description = "Returns/sets the background color used to display text and graphics in an object."
Attribute BackColor.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute BackColor.VB_UserMemId = -501
BackColor = M2000color(mBackColor)
End Property
Public Property Let BackColor(ByVal nValue As OLE_COLOR)
If nValue <> mBackColor Then
mBackColor = mycolor(nValue)
Me.Refresh
PropertyChanged "BackColor"
End If
End Property
Public Property Get BackStyle() As SEBackStyleConstants
Attribute BackStyle.VB_Description = "Indicates whether a Label or the background of a Shape is transparent or opaque."
Attribute BackStyle.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute BackStyle.VB_UserMemId = -502
BackStyle = mBackStyle
End Property
Public Property Let BackStyle(ByVal nValue As SEBackStyleConstants)
If nValue <> mBackStyle Then
mBackStyle = nValue
Me.Refresh
PropertyChanged "BackStyle"
End If
End Property
Public Property Get FillColor() As OLE_COLOR
Attribute FillColor.VB_Description = "Returns/sets the color used to fill in shapes, circles, and boxes."
Attribute FillColor.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute FillColor.VB_UserMemId = -510
FillColor = M2000color(mFillColor)
End Property
Public Property Let FillColor(ByVal nValue As OLE_COLOR)
If nValue <> mFillColor Then
mFillColor = mycolor(nValue)
Me.Refresh
PropertyChanged "FillColor"
End If
End Property
Public Property Get FillStyle() As SEFillStyle2Constants
Attribute FillStyle.VB_Description = "Returns/sets the fill style of a shape."
Attribute FillStyle.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute FillStyle.VB_UserMemId = -511
FillStyle = mFillStyle
End Property
Public Property Let FillStyle(ByVal nValue As SEFillStyle2Constants)
If nValue <> mFillStyle Then
If (nValue < seFSSolid) Or (nValue > seFSTransparent) Then Err.Raise 380, Typename(Me): Exit Property
mFillStyle = nValue
Me.Refresh
PropertyChanged "FillStyle"
End If
End Property
Public Property Get BorderStyle() As BorderStyleConstants
Attribute BorderStyle.VB_Description = "Returns/sets the border style for an object."
Attribute BorderStyle.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute BorderStyle.VB_UserMemId = -504
BorderStyle = mBorderStyle
End Property
Public Property Let BorderStyle(ByVal nValue As BorderStyleConstants)
If nValue <> mBorderStyle Then
If (nValue < vbTransparent) Or (nValue > vbBSInsideSolid) Then Err.Raise 380, Typename(Me): Exit Property
mBorderStyle = nValue
Me.Refresh
PropertyChanged "BorderStyle"
End If
End Property
Public Property Get BorderWidth() As Long
Attribute BorderWidth.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Attribute BorderWidth.VB_UserMemId = -505
BorderWidth = mBorderWidth
End Property
Public Property Let BorderWidth(ByVal nValue As Long)
If nValue < 1 Then
nValue = 1
End If
If nValue <> mBorderWidth Then
mBorderWidth = nValue
Me.Refresh
PropertyChanged "BorderWidth"
End If
End Property
Public Property Get Clickable() As Boolean
Attribute Clickable.VB_ProcData.VB_Invoke_Property = ";Comportamiento"
Clickable = mClickable
End Property
Public Property Let Clickable(ByVal nValue As Boolean)
If nValue <> mClickable Then
mClickable = nValue
Me.Refresh
PropertyChanged "Clickable"
End If
End Property
Public Property Get Quality() As SEQualityConstants
Attribute Quality.VB_ProcData.VB_Invoke_Property = ";Apariencia"
Quality = mQuality
End Property
Public Property Let Quality(ByVal nValue As SEQualityConstants)
If nValue <> mQuality Then
mQuality = nValue
Me.Refresh
PropertyChanged "Quality"
End If
End Property
Public Property Get RotationDegrees() As Single
RotationDegrees = mRotationDegrees
End Property
Public Property Let RotationDegrees(ByVal nValue As Single)
Dim iFraction As Single
If nValue <> mRotationDegrees Then
iFraction = nValue - Round(nValue)
nValue = nValue Mod 360
If nValue < 0 Then nValue = nValue + 360
nValue = nValue + iFraction
If nValue >= 360 Then
nValue = nValue - 360
ElseIf nValue < 0 Then
nValue = nValue + 360
End If
If nValue <> mRotationDegrees Then
mRotationDegrees = nValue
Me.Refresh
If mDrawingOutsideUC Then
If (UserControl.ContainerHwnd <> 0) And mSubclassed Then
PostMessage UserControl.ContainerHwnd, WM_INVALIDATE, 0&, 0&
End If
End If
PropertyChanged "RotationDegrees"
End If
End If
End Property
Public Property Get Opacity() As Single
Opacity = mOpacity
End Property
Public Property Let Opacity(ByVal nValue As Single)
If nValue <> mOpacity Then
If nValue > 100 Then
nValue = 100
ElseIf nValue < 0 Then
nValue = 0
End If
If nValue <> mOpacity Then
mOpacity = nValue
Me.Refresh
If mDrawingOutsideUC Then
If (UserControl.ContainerHwnd <> 0) And mSubclassed Then
PostMessage UserControl.ContainerHwnd, WM_INVALIDATE, 0&, 0&
End If
End If
PropertyChanged "Opacity"
End If
End If
End Property
Public Property Get shift() As Single
shift = mShift
End Property
Public Property Let shift(ByVal nValue As Single)
If nValue <> mShift Then
mShift = nValue
Me.Refresh
PropertyChanged "Shift"
End If
End Property
Public Property Get Vertices() As Integer
Vertices = mVertices
End Property
Public Property Let Vertices(ByVal nValue As Integer)
If nValue <> mVertices Then
mVertices = nValue
If mVertices < 2 Then mVertices = 2
If mVertices > 100 Then mVertices = 100
Me.Refresh
PropertyChanged "Vertices"
End If
End Property
Public Property Get CurvingFactor() As Integer
CurvingFactor = mCurvingFactor
End Property
Public Property Let CurvingFactor(ByVal nValue As Integer)
If nValue <> mCurvingFactor Then
mCurvingFactor = nValue
If mCurvingFactor < -100 Then mCurvingFactor = -100
If mCurvingFactor > 100 Then mCurvingFactor = 100
SetCurvingFactor2
Me.Refresh
If mDrawingOutsideUC Then
If (UserControl.ContainerHwnd <> 0) And mSubclassed Then
PostMessage UserControl.ContainerHwnd, WM_INVALIDATE, 0&, 0&
End If
End If
PropertyChanged "CurvingFactor"
End If
End Property
Public Property Get Flipped() As SEFlippedConstants
Flipped = mFlipped
End Property
Public Property Let Flipped(ByVal nValue As SEFlippedConstants)
If nValue <> mFlipped Then
mFlipped = nValue
Me.Refresh
PropertyChanged "Flipped"
End If
End Property
Public Property Get MousePointer() As VBRUN.MousePointerConstants
MousePointer = mMousePointer
End Property
Public Property Let MousePointer(ByVal nValue As VBRUN.MousePointerConstants)
If nValue <> mMousePointer Then
mMousePointer = nValue
UserControl.MousePointer = mMousePointer
PropertyChanged "MousePointer"
End If
End Property
Public Property Get MouseIcon() As StdPicture
Set MouseIcon = mMouseIcon
End Property
Public Property Let MouseIcon(ByVal nValue As StdPicture)
Set MouseIcon = nValue
End Property
Public Property Set MouseIcon(ByVal nValue As StdPicture)
If Not nValue Is mMouseIcon Then
Set mMouseIcon = nValue
Set UserControl.MouseIcon = mMouseIcon
PropertyChanged "MouseIcon"
End If
End Property
Public Property Get Style3D() As SEStyle3DConstants
Style3D = mStyle3D
End Property
Public Property Let Style3D(ByVal nValue As SEStyle3DConstants)
If nValue <> mStyle3D Then
If (nValue < seStyle3DNone) Or (nValue > seStyle3DBoth) Then Err.Raise 380, Typename(Me): Exit Property
mStyle3D = nValue
Me.Refresh
PropertyChanged "Style3D"
End If
End Property
Public Property Get Style3DEffect() As SEStyle3DEffectConstants
Style3DEffect = mStyle3DEffect
End Property
Public Property Let Style3DEffect(ByVal nValue As SEStyle3DEffectConstants)
If nValue <> mStyle3DEffect Then
If (nValue < seStyle3EffectAuto) Or (nValue > seStyle3EffectGem) Then Err.Raise 380, Typename(Me): Exit Property
mStyle3DEffect = nValue
Me.Refresh
PropertyChanged "Style3DEffect"
End If
End Property
Public Property Get UseSubclassing() As SESubclassingConstants
UseSubclassing = mUseSubclassing
End Property
Public Property Let UseSubclassing(ByVal nValue As SESubclassingConstants)
Dim iMessage As T_MSG
If nValue <> mUseSubclassing Then
If Not mUserMode Then
If nValue = seSCNo Then
MsgBox "In most cases subclassing is not necessary (and without subclassing is safer for running in the IDE), but in some special cases when the figure needs to be painted outside the control bounds, it may experience glitches.", vbInformation
End If
End If
mUseSubclassing = nValue
If mUseSubclassing <> seSCNo Then
If mSubclassed Then pvUnsubclass
pvSubclass
If mSubclassed Then
If mDrawingOutsideUC Then
If (UserControl.ContainerHwnd <> 0) And mSubclassed Then
PostMessage UserControl.ContainerHwnd, WM_INVALIDATE, 0&, 0&
End If
End If
Else
If UserControl.ContainerHwnd <> 0 Then
PeekMessage iMessage, UserControl.ContainerHwnd, WM_INVALIDATE, WM_INVALIDATE, PM_REMOVE ' remove posted message, if any
End If
End If
Else
If mSubclassed Then pvUnsubclass
If UserControl.ContainerHwnd <> 0 Then
PeekMessage iMessage, UserControl.ContainerHwnd, WM_INVALIDATE, WM_INVALIDATE, PM_REMOVE ' remove posted message, if any
End If
End If
PropertyChanged "UseSubclassing"
End If
End Property
Public Property Get hWnd() As Long
Attribute hWnd.VB_UserMemId = -515
hWnd = UserControl.hWnd
End Property
Public Sub Refresh()
Attribute Refresh.VB_UserMemId = -550
UserControl.Refresh
End Sub
Private Sub Draw()
Dim iDiameter As Long
Dim iGraphics As Long
Dim iFillColor As Long
Dim iFilled As Boolean
Dim iheight As Long