【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,Ex9_11.frm,希望对大家有所帮助!
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; ""
Begin VB.Form Ex9_11
Caption = "使用ImageList控件"
ClientHeight = 1755
ClientLeft = 60
ClientTop = 450
ClientWidth = 4305
LinkTopic = "Form1"
ScaleHeight = 1755
ScaleWidth = 4305
StartUpPosition = 3 '窗口缺省
Begin VB.PictureBox Picture1
AutoSize = -1 'True
Height = 615
Left = 240
ScaleHeight = 555
ScaleWidth = 2115
TabIndex = 1
Top = 240
Width = 2175
Begin VB.Image Image1
Height = 495
Left = 1440
Stretch = -1 'True
Top = 0
Width = 615
End
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "Ex9_11.frx":0000
Left = 2640
List = "Ex9_11.frx":0013
TabIndex = 0
Top = 360
Width = 1575
End
Begin MSComctlLib.ImageList ImageList1
Left = 2520
Top = 960
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 24
ImageHeight = 23
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Ex9_11.frx":0026
Key = "打开"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Ex9_11.frx":06A0
Key = "保存"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Ex9_11.frx":0D1A
Key = "剪切"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Ex9_11.frx":1394
Key = "复制"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Ex9_11.frx":1A0E
Key = "粘贴"
EndProperty
EndProperty
End
End
Attribute
VB_Name = "Ex9_11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Picture1.Cls '清除控件上的文本
Picture1.Print '打印一个空行
'打印ImageList1控件索引为Combo1.ListIndex + 1的图像的关键字和相关内容
Picture1.Print ImageList1.ListImages( _
Combo1.ListIndex + 1).Key & ",图标为"
'根据Combo1中选择的项在图像框显示相应的图像
Set Image1.Picture = ImageList1.ListImages( _
Combo1.ListIndex + 1).ExtractIcon
End Sub