?? nfbutton.ctl
字號:
VERSION 5.00
Begin VB.UserControl NFButton
AutoRedraw = -1 'True
ClientHeight = 765
ClientLeft = 0
ClientTop = 0
ClientWidth = 1875
ScaleHeight = 765
ScaleWidth = 1875
Begin VB.Line LeftLine
BorderColor = &H80000005&
X1 = 135
X2 = 135
Y1 = 90
Y2 = 495
End
Begin VB.Line TopLine
BorderColor = &H00FFFFFF&
X1 = 180
X2 = 1665
Y1 = 90
Y2 = 90
End
Begin VB.Line RightLine
BorderColor = &H00404040&
X1 = 1755
X2 = 1755
Y1 = 135
Y2 = 405
End
Begin VB.Line BottomLine
X1 = 225
X2 = 1710
Y1 = 585
Y2 = 585
End
End
Attribute VB_Name = "NFButton"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Dim m_caption As String
Dim m_borderwidth
Public Event Click()
Public Property Get Caption() As Variant
Caption = m_caption
End Property
Public Property Let Caption(ByVal vNewValue As Variant)
m_caption = vNewValue
Cls
CurrentX = UserControl.ScaleWidth / 2 - TextWidth(m_caption) / 2
CurrentY = UserControl.ScaleHeight / 2 - TextHeight(m_caption) / 2
Print m_caption
PropertyChanged "Caption"
End Property
Private Sub UserControl_Click()
RaiseEvent Click
End Sub
Private Sub UserControl_DblClick()
RaiseEvent Click
End Sub
Private Sub UserControl_InitProperties()
m_borderwidth = 1
m_caption = UserControl.Name
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_caption = PropBag.ReadProperty("Caption", m_caption)
m_borderwidth = PropBag.ReadProperty("BorderWidth", 1)
End Sub
Public Property Get BorderWidth() As Variant
BorderWidth = m_borderwidth
End Property
Public Property Let BorderWidth(ByVal vNewValue As Variant)
m_borderwidth = vNewValue
PropertyChanged "BorderWidth"
End Property
Private Sub UserControl_Resize()
UserControl.ScaleMode = 2
Cls
TopLine.BorderWidth = m_borderwidth
LeftLine.BorderWidth = m_borderwidth
RightLine.BorderWidth = m_borderwidth
BottomLine.BorderWidth = m_borderwidth
RightLine.X1 = UserControl.ScaleWidth - m_borderwidth / 2
RightLine.X2 = UserControl.ScaleWidth - m_borderwidth / 2
RightLine.Y1 = m_borderwidth / 2
RightLine.Y2 = UserControl.ScaleHeight
TopLine.X1 = 0
TopLine.X2 = UserControl.ScaleWidth
TopLine.Y1 = 0
TopLine.Y2 = 0
LeftLine.X1 = 0
LeftLine.X2 = 0
LeftLine.Y1 = 0
LeftLine.Y2 = UserControl.ScaleHeight - m_borderwidth
BottomLine.X1 = 0
BottomLine.X2 = UserControl.ScaleWidth
BottomLine.Y1 = UserControl.ScaleHeight - m_borderwidth / 2
BottomLine.Y2 = UserControl.ScaleHeight - m_borderwidth / 2
CurrentX = UserControl.ScaleWidth / 2 - TextWidth(m_caption) / 2
CurrentY = UserControl.ScaleHeight / 2 - TextHeight(m_caption) / 2
Print m_caption
End Sub
Private Sub UserControl_Show()
CurrentX = UserControl.ScaleWidth / 2 - TextWidth(m_caption) / 2
CurrentY = UserControl.ScaleHeight / 2 - TextHeight(m_caption) / 2
Print m_caption
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "Caption", m_caption
PropBag.WriteProperty "BorderWidth", m_borderwidth, 1
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -