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

📄 frmimagecombo.frm

📁 这是一个非常全的VB+AO二次开发实例集
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmImageCombo 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin MSComctlLib.ImageCombo ImageCombo1 
      Height          =   315
      Left            =   2760
      TabIndex        =   0
      Top             =   840
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   556
      _Version        =   393216
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Text            =   "ImageCombo1"
   End
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   960
      Top             =   840
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   16
      ImageHeight     =   16
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmImageCombo.frx":0000
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmImageCombo.frx":0112
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "frmImageCombo.frx":0224
            Key             =   ""
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "frmImageCombo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Load()
    ' 设置ImageCombo1的选择Item
    Me.ImageCombo1.ImageList = Me.ImageList1
    Me.ImageCombo1.ComboItems.Add 1, "Red", "Red"
    Me.ImageCombo1.ComboItems.Add 2, "Blue", "Blue"
    Me.ImageCombo1.ComboItems.Add 3, "Green", "Green"
    Me.ImageCombo1.ComboItems(1).Image = 1
    Me.ImageCombo1.ComboItems(2).Image = 2
    Me.ImageCombo1.ComboItems(3).Image = 3
End Sub

Private Sub ImageCombo1_Click()
    ' 选择颜色
    Dim sel As Variant
    sel = Me.ImageCombo1.SelectedItem
    Dim color As Variant
    Select Case sel
        Case "Blue"
            color = vbBlue
        Case "Red"
            color = vbRed
        Case "Green"
            color = vbGreen
    End Select
    Dim pDocument As IMxDocument
    Set pDocument = g_pApplication.Document
    ' 设置颜色
    Dim pRgbColor As IRgbColor
    Set pRgbColor = New RgbColor
    pRgbColor.RGB = color
    ' 改变选中部分的颜色
    Dim pSelectionEnvironment As ISelectionEnvironment
    Set pSelectionEnvironment = New SelectionEnvironment
    Set pSelectionEnvironment.DefaultColor = pRgbColor
    pDocument.ActivatedView.Refresh
    ' 通知ArcMap,ToolControl现在可以失去Focus
    g_pCompletionNotify.SetComplete
End Sub

⌨️ 快捷键说明

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