⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.frm

📁 一款绝对漂亮的窗体界面控件
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Begin VB.Frame Frame2 
         Appearance      =   0  'Flat
         Caption         =   "风格:"
         ForeColor       =   &H80000008&
         Height          =   1995
         Left            =   2340
         TabIndex        =   8
         Top             =   765
         Width           =   2355
         Begin VB.OptionButton OptnStyle 
            Appearance      =   0  'Flat
            Caption         =   "风格4"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   180
            TabIndex        =   12
            Top             =   1485
            Width           =   915
         End
         Begin VB.OptionButton OptnStyle 
            Appearance      =   0  'Flat
            Caption         =   "风格3"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   180
            TabIndex        =   11
            Top             =   1095
            Value           =   -1  'True
            Width           =   915
         End
         Begin VB.OptionButton OptnStyle 
            Appearance      =   0  'Flat
            Caption         =   "风格2"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   180
            TabIndex        =   10
            Top             =   720
            Width           =   915
         End
         Begin VB.OptionButton OptnStyle 
            Appearance      =   0  'Flat
            Caption         =   "风格1"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   180
            TabIndex        =   9
            Top             =   330
            Width           =   915
         End
      End
      Begin VB.Frame Frame1 
         Appearance      =   0  'Flat
         Caption         =   "主题色彩:"
         ForeColor       =   &H80000008&
         Height          =   4125
         Left            =   240
         TabIndex        =   1
         Top             =   765
         Width           =   1935
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "自适应"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   6
            Left            =   180
            TabIndex        =   17
            Top             =   3540
            Value           =   -1  'True
            Width           =   1395
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "自定义"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   5
            Left            =   180
            TabIndex        =   7
            Top             =   3030
            Width           =   1395
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "诺顿色(金黄)"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   4
            Left            =   180
            TabIndex        =   6
            Top             =   2520
            Width           =   1395
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "Visual Studio"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   3
            Left            =   180
            TabIndex        =   5
            Top             =   2010
            Width           =   1680
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "橄榄绿"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   2
            Left            =   180
            TabIndex        =   4
            Top             =   1500
            Width           =   1395
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "银色"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   1
            Left            =   180
            TabIndex        =   3
            Top             =   990
            Width           =   1395
         End
         Begin VB.OptionButton OptnTheme 
            Appearance      =   0  'Flat
            Caption         =   "蓝色"
            ForeColor       =   &H80000008&
            Height          =   255
            Index           =   0
            Left            =   180
            TabIndex        =   2
            Top             =   480
            Width           =   1395
         End
      End
   End
End
Attribute VB_Name = "Demo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private PicIniColor(0 To 2) As String

Private Sub CboIconSize_Click()
    
    jcForms1.IconSize = Val(CboIconSize.Text)

End Sub

Private Sub Check1_Click()
    
    Dim intI As Integer
    
    jcForms1.ChangeAllBackgrounds = Check1.Value
    
    For intI = 0 To 2
        Me.OptnBackcolorStyle(intI).Enabled = Not Me.OptnBackcolorStyle(intI).Enabled
    Next intI

End Sub

Private Sub Chkclose_Click()
    
    jcForms1.CloseButton = Chkclose.Value

End Sub

Private Sub ChkMax_Click()
    
    jcForms1.MaxButton = ChkMax.Value

End Sub

Private Sub ChkMin_Click()
    
    jcForms1.MinButton = ChkMin.Value

End Sub

Private Sub Command1_Click()
    
    If Me.Caption = "皮肤更换控件演示 Ver 1.0.4                 " Then
        Me.Caption = "窗体标题在运行时改变           "
    Else
        Me.Caption = "欢迎访问枕善居 http://www.mndsoft.com           "
    End If
    
    jcForms1.Refresh

End Sub

Private Sub Command2_Click()
    
    If Command2.Caption = "增加菜单项" Then
        Me.jcForms1.FormMenuAdd "在运行时添加系统菜单.", True
        Command2.Caption = "移除菜单项"
    Else
        Command2.Caption = "增加菜单项"
        Me.jcForms1.FormMenuRemove 13
    End If

End Sub

Private Sub Form_Load()
    
    PicIniColor(0) = "47"
    PicIniColor(1) = "25"
    PicIniColor(2) = "20"
    CboIconSize.Text = 16
    
    OptnTheme(6).Value = True
    OptnColors(0).Value = True
    jcForms1.CustomBackColor = RGB(240, 239, 176)
    
    ShpColor.Move 1 + Val(Left(PicIniColor(0), 1)) * 17, 1 + Val(Right(PicIniColor(0), 1)) * 17
    
    Me.jcForms1.FormMenuAdd "菜单项示例 1", True
    Me.jcForms1.FormMenuAdd "菜单项示例 2", , , True
    Me.jcForms1.FormMenuAdd "http://www.mndsoft.com"
    Me.jcForms1.FormMenuAdd "欢迎访问枕善居"
End Sub

Private Sub Option1_Click(Index As Integer)
    
    jcForms1.BorderStyle = Index

End Sub

Private Sub OptnBackcolorStyle_Click(Index As Integer)
    
    jcForms1.BackColorStyle = Index
    
    If Index = 2 Then
        OptnColors(0).Value = True
    End If
    
End Sub

Private Sub OptnColors_Click(Index As Integer)
    
    ShpColor.Move 1 + Val(Left(PicIniColor(Index), 1)) * 17, 1 + Val(Right(PicIniColor(Index), 1)) * 17
    
    If Index = 0 Then
        If OptnBackcolorStyle(2).Value = False Then
            OptnBackcolorStyle(2).Value = True
        End If
    End If

End Sub

Private Sub OptnStyle_Click(Index As Integer)
    
    jcForms1.Style = Index

End Sub

Private Sub OptnTheme_Click(Index As Integer)
    
    jcForms1.ThemeColor = Index
    
    If Index = 5 Then
        OptnColors(1).Value = True
    End If

End Sub

Private Sub picColor_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
    Dim MyRow       As Single
    Dim MyCol       As Single
    
    MyRow = Fix((X - 2) / 17)
    MyCol = Fix((Y - 2) / 17)
    
    ShpColor.Move 1 + MyRow * 17, 1 + MyCol * 17
    
    If OptnColors(0).Value = True Then
        jcForms1.CustomBackColor = picColor.POINT(X, Y)
        PicIniColor(0) = MyRow & MyCol
    ElseIf OptnColors(1).Value = True Then
        jcForms1.ColorFrom = picColor.POINT(X, Y)
        PicIniColor(1) = MyRow & MyCol
    ElseIf OptnColors(2).Value = True Then
        jcForms1.ColorTo = picColor.POINT(X, Y)
        PicIniColor(2) = MyRow & MyCol
    End If
    
End Sub

Private Sub jcForms1_MenuItemSelected(MenuItem As Integer, MenuCaption As String)
    
    MsgBox "菜单项 = " & MenuItem & " 被单击, 菜单标题 = " & MenuCaption
    
    If MenuItem = 6 Then
        jcForms1.ModifyAddedMenu MenuItem, , , Not jcForms1.GetMenuItemValue(MenuItem, Checked)
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -