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

📄 form1.frm

📁 vb源码大全
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1 
   Caption         =   "颜色渐变文本"
   ClientHeight    =   4185
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5040
   LinkTopic       =   "Form1"
   ScaleHeight     =   4185
   ScaleWidth      =   5040
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CDlg 
      Left            =   3240
      Top             =   3120
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.OptionButton optGradient 
      Caption         =   "球形渐变"
      Height          =   255
      Index           =   2
      Left            =   3120
      TabIndex        =   8
      Top             =   1440
      Width           =   1335
   End
   Begin VB.OptionButton optGradient 
      Caption         =   "矩形渐变"
      Height          =   495
      Index           =   1
      Left            =   1560
      TabIndex        =   7
      Top             =   1320
      Width           =   1335
   End
   Begin VB.OptionButton optGradient 
      Caption         =   "水平渐变"
      Height          =   255
      Index           =   0
      Left            =   0
      TabIndex        =   6
      Top             =   1440
      Value           =   -1  'True
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   120
      TabIndex        =   2
      Text            =   "Word Art"
      Top             =   2040
      Width           =   4335
   End
   Begin VB.CommandButton cmdGo 
      Caption         =   "绘制"
      Height          =   375
      Left            =   3480
      TabIndex        =   1
      Top             =   480
      Width           =   1260
   End
   Begin VB.PictureBox picResult 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00FF00FF&
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   18
         Charset         =   178
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1020
      Left            =   120
      ScaleHeight     =   960
      ScaleWidth      =   960
      TabIndex        =   0
      Top             =   3000
      Width           =   1020
   End
   Begin VB.PictureBox PicTmp 
      BackColor       =   &H00FFFFFF&
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   178
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1095
      Left            =   1920
      ScaleHeight     =   1035
      ScaleWidth      =   1155
      TabIndex        =   9
      Top             =   3000
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "结束颜色"
      Height          =   180
      Left            =   1680
      TabIndex        =   11
      Top             =   120
      Width           =   720
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "开始颜色"
      Height          =   180
      Left            =   120
      TabIndex        =   10
      Top             =   120
      Width           =   720
   End
   Begin VB.Label Color2Box 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H00FF0000&
      BorderStyle     =   1  'Fixed Single
      ForeColor       =   &H000000C0&
      Height          =   615
      Left            =   1680
      TabIndex        =   5
      Top             =   480
      Width           =   1095
      WordWrap        =   -1  'True
   End
   Begin VB.Label Color1Box 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H00000000&
      BorderStyle     =   1  'Fixed Single
      ForeColor       =   &H000000C0&
      Height          =   615
      Left            =   120
      TabIndex        =   4
      Top             =   480
      Width           =   1095
      WordWrap        =   -1  'True
   End
   Begin VB.Label txtLen 
      AutoSize        =   -1  'True
      BorderStyle     =   1  'Fixed Single
      Height          =   240
      Left            =   3840
      TabIndex        =   3
      Top             =   3240
      Visible         =   0   'False
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
 Dim GradType As Integer
'gradtype flage:
'   1) horizontal
'   2) rectangular
'   3) spherical

Private Sub cmdGo_Click()
    DrawTxt True, Text1.Text, Color1Box.BackColor, Color2Box.BackColor, GradType
End Sub

Private Sub Color1Box_Click()
    CDlg.ShowColor
    Color1Box.BackColor = CDlg.Color
End Sub

Private Sub Color2Box_Click()
    CDlg.ShowColor
    Color2Box.BackColor = CDlg.Color
End Sub

Private Sub Form_Load()
    PicTmp.AutoRedraw = True
    PicTmp.FontSize = 20
    GradType = 1
    cmdGo_Click
End Sub

Private Sub optGradient_Click(Index As Integer)
    GradType = Index + 1
End Sub

⌨️ 快捷键说明

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