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

📄 formdrawmode.frm

📁 个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form formDrawMode 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "DrawMode演示"
   ClientHeight    =   5355
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6645
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5355
   ScaleWidth      =   6645
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text3 
      Height          =   270
      Left            =   5100
      TabIndex        =   2
      Top             =   120
      Width           =   1455
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   2700
      TabIndex        =   1
      Top             =   120
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   900
      TabIndex        =   0
      Top             =   120
      Width           =   795
   End
   Begin VB.Label Label3 
      Caption         =   "FillColor"
      Height          =   315
      Left            =   4260
      TabIndex        =   5
      Top             =   120
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "ForeColor"
      Height          =   255
      Left            =   1740
      TabIndex        =   4
      Top             =   120
      Width           =   1035
   End
   Begin VB.Label Label1 
      Caption         =   "DrawMode"
      Height          =   255
      Left            =   60
      TabIndex        =   3
      Top             =   120
      Width           =   735
   End
End
Attribute VB_Name = "formDrawMode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub DisplayColor(Num As Integer, Con As Control)
    If Num = 0 Then Con.Text = "Black"
    If Num = 1 Then Con.Text = "Blue"
    If Num = 2 Then Con.Text = "Green"
    If Num = 3 Then Con.Text = "Cyan"
    If Num = 4 Then Con.Text = "Red"
    If Num = 5 Then Con.Text = "Magenta"
    If Num = 6 Then Con.Text = "Yellow"
    If Num = 7 Then Con.Text = "White"
    If Num = 8 Then Con.Text = "Gray"
    If Num = 9 Then Con.Text = "Light Blue"
    If Num = 10 Then Con.Text = "Light Green"
    If Num = 11 Then Con.Text = "Light Cyan"
    If Num = 12 Then Con.Text = "Light Red"
    If Num = 13 Then Con.Text = "Light Magenta"
    If Num = 14 Then Con.Text = "Light Yellow"
    If Num = 15 Then Con.Text = "Bright White"
    
End Sub

Private Sub Form_DblClick()
    Static Color As Integer
    Cls
    FillColor = QBColor(Color)
    FillStyle = 0
    DrawWidth = 5
    ForeColor = QBColor(1)
    If DrawMode = 16 Then
        DrawMode = 1
    Else
        DrawMode = DrawMode + 1
    End If
    Text1.Text = Str(DrawMode)
    DisplayColor Color, Text2
    x = ScaleWidth / 2
    y = ScaleHeight / 2
    r = ScaleWidth / 4
    Circle (x, y), r
    If Color = 15 Then
        Color = 0
    Else
        Color = Color + 1
    End If
    FillColor = QBColor(Color)
    DisplayColor Color, Text3
    x = 2 * ScaleWidth / 3
    y = 2 * ScaleHeight / 3
    Circle (x, y), 1000
End Sub

⌨️ 快捷键说明

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