本文整理匯總了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