vb代码-颜渐变的标题栏(VB code - color gradient title bar)
'a gradual change in the title box, in this case we can see the application skills of drawing
Especially the method of realizing gradient, it is worth us to draw lessons from
'it also involves dragging the untitled window
Option Explicit
Private IsMaximized As Boolean
Private IsMinimized As Boolean
Private ButtonsCount As Integer
Private Sub Form_Paint ()
ReSize
EndFRDrag Me.Top, Me.Left
End Sub
Private Sub imgCloseForm_MouseDown (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
ImgCloseForm.Picture = imgCloseFormButtonDown.Picture
End Sub
Private Sub imgCloseForm_MouseUp (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
'Unload All of the Forms
Dim frm As Form
ImgCloseForm.Picture = imgCloseFormButton.Picture
For Each frm In Forms
Unload FRM
Next FRM
End
End Sub
Private Sub imgMaximize_MouseDown (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
If IsMaximized = True Then
ImgMaximize.Picture = imgNormalizeButtonDown.Picture
Else
ImgMaximize.Picture = imgMaximizeButtonDown.Picture
End If
End Sub
Private Sub imgMaximize_MouseUp (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
If IsMaximized = False Then
Me.WindowState = 2
IsMaximized = True
Form_Resize
ImgMaximize.Picture = imgNormalizeButton.Picture
Else
Me.WindowState = 0
IsMaximized = False
Form_Resize
ImgMaximize.Picture = imgMaximizeButton.Picture
End If
End Sub
Private Sub imgMinimize_MouseDown (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
ImgMinimize.Picture = imgMinimizeButtonDown.Picture
End Sub
Private Sub imgMinimize_MouseUp (Button, As, Shift, As, x, As, y, As, Single, Integer, Single, Integer)
If IsMinimized = False Then
Me.WindowState = 1
IsMinimized = True
Form_Resize
ImgMinimize.Picture = imgMinimizeButton.Picture
Else
Me.WindowState = 0
渐变颜代码大全IsMinimized = False
Form_Resize
ImgMinimize.Picture = imgMinimizeButton.Picture
End If
End Sub
Private Sub Form_Activate ()
IsMinimized = False
End Sub
Private Sub Form_Load ()
Dim frameHeight As Long
Dim frameWidth As Long
Me.ScaleMode = 3
''compute the width of the left and right dialog frame FrameHeight = GetSystemMetrics (SM_CYDLGFRAME) * 2
''compute the width of the top and bottom dialog frame FrameWidth = GetSystemMetrics (SM_CXDLGFRAME) * 2
me.scalemode = 1
buttonscount = 0
如果Me.MaxButton真的那么buttonscount = buttonscount + 1

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。