本文整理汇总了VB.NET中System.Windows.Forms.TabPage.ImageIndex属性的典型用法代码示例。如果您正苦于以下问题:VB.NET TabPage.ImageIndex属性的具体用法?VB.NET TabPage.ImageIndex怎么用?VB.NET TabPage.ImageIndex使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.TabPage
的用法示例。
在下文中一共展示了TabPage.ImageIndex属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Form1
' 导入命名空间
Imports System.Drawing
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Resources
Public Class Form1
Inherits Form
Public Sub New()
Dim components = New Container()
Dim resources As New ResourceManager(GetType(Form1))
Dim tabControl1 As New TabControl()
Dim tabPage1 As New TabPage()
Dim myImages As New ImageList(components)
tabControl1.Controls.Add(tabPage1)
' Displays images from myImages on the tabs of tabControl1.
tabControl1.ImageList = myImages
' Specifies which image to display (on the tab of tabPage1) by its index.
tabPage1.ImageIndex = 0
tabPage1.Text = "tabPage1"
myImages.ImageStream = CType(resources.GetObject("myImages.ImageStream"), ImageListStreamer)
myImages.ColorDepth = ColorDepth.Depth8Bit
myImages.ImageSize = New Size(16, 16)
myImages.TransparentColor = Color.Transparent
Me.Controls.Add(tabControl1)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
End Class