?? vb_net.txt
字號:
Imports System.Globalization
Imports System.Resources
Imports System.Threading
Imports Microsoft.Win32
'The .NET Resource Manager loads resources in a hierarchical manner. This sample
'demonstrates the fallback system in which resources are loaded.
'The Resource Manager will attempt to load the specific culture, which in
'this sample is "de-AT" or "de-DE". If the resources are not found for the
'specific culture, it will attempt to load the neutral culture, which in this
'case is "de".
'If the requested resources are still not found, the loader "falls back" to
'the resources include in the main assembly, which are marked as "neutral language"
'In this sample, the neutral resources are in English, but could theoretically
'be in any language.
Public Class Form1
Inherits System.Windows.Forms.Form
Private PreferredUICulture As String 'Saves the users' preferred UI language
Dim VBLocDemoUILanguageKey As RegistryKey 'Stores the users' preferred UI Language
Private MyResMgr As ResourceManager = New ResourceManager("VBLocDemo.LocStrings", GetType(Form1).Module.Assembly) 'Create a resource manager for loading strings for the MessageBox
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
ReadRegistryKey() 'Read the registry for user's preferred languages
Try
Thread.CurrentThread.CurrentUICulture = New CultureInfo(PreferredUICulture) 'Set the CurrentUICulture to language preference stored in the registry
Catch
Thread.CurrentThread.CurrentUICulture = New CultureInfo("", False) 'If no language is set, use the fallback language, which are the resources compiled in the main assembly
End Try
'This call is required by the Windows Form Designer.
InitializeComponent()
FillUICultureComboBox(cmbUICulture) 'Fill the combobox with the available UI Cultures
Dim CurrentDate As New DateTime()
stbDateTime.Text = CurrentDate.Now.ToLongDateString
'ToString uses the locale-specific formatting defined by the system's user locale
'Here we just use the system settings, since this is the usual case
'If you want the date setting to display in a specific locale format, you can set Thread.CurrentThread.CurrentCulture to the specific culture of your choice
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Friend WithEvents lblUICulture As System.Windows.Forms.Label
Friend WithEvents lblCulture As System.Windows.Forms.Label
Friend WithEvents cmbUICulture As System.Windows.Forms.ComboBox
Friend WithEvents stbDateTime As System.Windows.Forms.StatusBar
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents mnuFile As System.Windows.Forms.MenuItem
Friend WithEvents mnuExit As System.Windows.Forms.MenuItem
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.lblUICulture = New System.Windows.Forms.Label()
Me.lblCulture = New System.Windows.Forms.Label()
Me.cmbUICulture = New System.Windows.Forms.ComboBox()
Me.stbDateTime = New System.Windows.Forms.StatusBar()
Me.Button1 = New System.Windows.Forms.Button()
Me.MainMenu1 = New System.Windows.Forms.MainMenu()
Me.mnuFile = New System.Windows.Forms.MenuItem()
Me.mnuExit = New System.Windows.Forms.MenuItem()
Me.SuspendLayout()
'
'lblUICulture
'
Me.lblUICulture.AccessibleDescription = CType(resources.GetObject("lblUICulture.AccessibleDescription"), String)
Me.lblUICulture.AccessibleName = CType(resources.GetObject("lblUICulture.AccessibleName"), String)
Me.lblUICulture.Anchor = CType(resources.GetObject("lblUICulture.Anchor"), System.Windows.Forms.AnchorStyles)
Me.lblUICulture.AutoSize = CType(resources.GetObject("lblUICulture.AutoSize"), Boolean)
Me.lblUICulture.Cursor = CType(resources.GetObject("lblUICulture.Cursor"), System.Windows.Forms.Cursor)
Me.lblUICulture.Dock = CType(resources.GetObject("lblUICulture.Dock"), System.Windows.Forms.DockStyle)
Me.lblUICulture.Enabled = CType(resources.GetObject("lblUICulture.Enabled"), Boolean)
Me.lblUICulture.Font = CType(resources.GetObject("lblUICulture.Font"), System.Drawing.Font)
Me.lblUICulture.Image = CType(resources.GetObject("lblUICulture.Image"), System.Drawing.Image)
Me.lblUICulture.ImageAlign = CType(resources.GetObject("lblUICulture.ImageAlign"), System.Drawing.ContentAlignment)
Me.lblUICulture.ImageIndex = CType(resources.GetObject("lblUICulture.ImageIndex"), Integer)
Me.lblUICulture.ImeMode = CType(resources.GetObject("lblUICulture.ImeMode"), System.Windows.Forms.ImeMode)
Me.lblUICulture.Location = CType(resources.GetObject("lblUICulture.Location"), System.Drawing.Point)
Me.lblUICulture.Name = "lblUICulture"
Me.lblUICulture.RightToLeft = CType(resources.GetObject("lblUICulture.RightToLeft"), System.Windows.Forms.RightToLeft)
Me.lblUICulture.Size = CType(resources.GetObject("lblUICulture.Size"), System.Drawing.Size)
Me.lblUICulture.TabIndex = CType(resources.GetObject("lblUICulture.TabIndex"), Integer)
Me.lblUICulture.Text = resources.GetString("lblUICulture.Text")
Me.lblUICulture.TextAlign = CType(resources.GetObject("lblUICulture.TextAlign"), System.Drawing.ContentAlignment)
Me.lblUICulture.Visible = CType(resources.GetObject("lblUICulture.Visible"), Boolean)
'
'lblCulture
'
Me.lblCulture.AccessibleDescription = CType(resources.GetObject("lblCulture.AccessibleDescription"), String)
Me.lblCulture.AccessibleName = CType(resources.GetObject("lblCulture.AccessibleName"), String)
Me.lblCulture.Anchor = CType(resources.GetObject("lblCulture.Anchor"), System.Windows.Forms.AnchorStyles)
Me.lblCulture.AutoSize = CType(resources.GetObject("lblCulture.AutoSize"), Boolean)
Me.lblCulture.Cursor = CType(resources.GetObject("lblCulture.Cursor"), System.Windows.Forms.Cursor)
Me.lblCulture.Dock = CType(resources.GetObject("lblCulture.Dock"), System.Windows.Forms.DockStyle)
Me.lblCulture.Enabled = CType(resources.GetObject("lblCulture.Enabled"), Boolean)
Me.lblCulture.Font = CType(resources.GetObject("lblCulture.Font"), System.Drawing.Font)
Me.lblCulture.Image = CType(resources.GetObject("lblCulture.Image"), System.Drawing.Image)
Me.lblCulture.ImageAlign = CType(resources.GetObject("lblCulture.ImageAlign"), System.Drawing.ContentAlignment)
Me.lblCulture.ImageIndex = CType(resources.GetObject("lblCulture.ImageIndex"), Integer)
Me.lblCulture.ImeMode = CType(resources.GetObject("lblCulture.ImeMode"), System.Windows.Forms.ImeMode)
Me.lblCulture.Location = CType(resources.GetObject("lblCulture.Location"), System.Drawing.Point)
Me.lblCulture.Name = "lblCulture"
Me.lblCulture.RightToLeft = CType(resources.GetObject("lblCulture.RightToLeft"), System.Windows.Forms.RightToLeft)
Me.lblCulture.Size = CType(resources.GetObject("lblCulture.Size"), System.Drawing.Size)
Me.lblCulture.TabIndex = CType(resources.GetObject("lblCulture.TabIndex"), Integer)
Me.lblCulture.Text = resources.GetString("lblCulture.Text")
Me.lblCulture.TextAlign = CType(resources.GetObject("lblCulture.TextAlign"), System.Drawing.ContentAlignment)
Me.lblCulture.Visible = CType(resources.GetObject("lblCulture.Visible"), Boolean)
'
'cmbUICulture
'
Me.cmbUICulture.AccessibleDescription = CType(resources.GetObject("cmbUICulture.AccessibleDescription"), String)
Me.cmbUICulture.AccessibleName = CType(resources.GetObject("cmbUICulture.AccessibleName"), String)
Me.cmbUICulture.Anchor = CType(resources.GetObject("cmbUICulture.Anchor"), System.Windows.Forms.AnchorStyles)
Me.cmbUICulture.BackgroundImage = CType(resources.GetObject("cmbUICulture.BackgroundImage"), System.Drawing.Image)
Me.cmbUICulture.Cursor = CType(resources.GetObject("cmbUICulture.Cursor"), System.Windows.Forms.Cursor)
Me.cmbUICulture.Dock = CType(resources.GetObject("cmbUICulture.Dock"), System.Windows.Forms.DockStyle)
Me.cmbUICulture.Enabled = CType(resources.GetObject("cmbUICulture.Enabled"), Boolean)
Me.cmbUICulture.Font = CType(resources.GetObject("cmbUICulture.Font"), System.Drawing.Font)
Me.cmbUICulture.ImeMode = CType(resources.GetObject("cmbUICulture.ImeMode"), System.Windows.Forms.ImeMode)
Me.cmbUICulture.IntegralHeight = CType(resources.GetObject("cmbUICulture.IntegralHeight"), Boolean)
Me.cmbUICulture.ItemHeight = CType(resources.GetObject("cmbUICulture.ItemHeight"), Integer)
Me.cmbUICulture.Location = CType(resources.GetObject("cmbUICulture.Location"), System.Drawing.Point)
Me.cmbUICulture.MaxDropDownItems = CType(resources.GetObject("cmbUICulture.MaxDropDownItems"), Integer)
Me.cmbUICulture.MaxLength = CType(resources.GetObject("cmbUICulture.MaxLength"), Integer)
Me.cmbUICulture.Name = "cmbUICulture"
Me.cmbUICulture.RightToLeft = CType(resources.GetObject("cmbUICulture.RightToLeft"), System.Windows.Forms.RightToLeft)
Me.cmbUICulture.Size = CType(resources.GetObject("cmbUICulture.Size"), System.Drawing.Size)
Me.cmbUICulture.TabIndex = CType(resources.GetObject("cmbUICulture.TabIndex"), Integer)
Me.cmbUICulture.Text = resources.GetString("cmbUICulture.Text")
Me.cmbUICulture.Visible = CType(resources.GetObject("cmbUICulture.Visible"), Boolean)
'
'stbDateTime
'
Me.stbDateTime.AccessibleDescription = CType(resources.GetObject("stbDateTime.AccessibleDescription"), String)
Me.stbDateTime.AccessibleName = CType(resources.GetObject("stbDateTime.AccessibleName"), String)
Me.stbDateTime.Anchor = CType(resources.GetObject("stbDateTime.Anchor"), System.Windows.Forms.AnchorStyles)
Me.stbDateTime.BackgroundImage = CType(resources.GetObject("stbDateTime.BackgroundImage"), System.Drawing.Image)
Me.stbDateTime.Cursor = CType(resources.GetObject("stbDateTime.Cursor"), System.Windows.Forms.Cursor)
Me.stbDateTime.Dock = CType(resources.GetObject("stbDateTime.Dock"), System.Windows.Forms.DockStyle)
Me.stbDateTime.Enabled = CType(resources.GetObject("stbDateTime.Enabled"), Boolean)
Me.stbDateTime.Font = CType(resources.GetObject("stbDateTime.Font"), System.Drawing.Font)
Me.stbDateTime.ImeMode = CType(resources.GetObject("stbDateTime.ImeMode"), System.Windows.Forms.ImeMode)
Me.stbDateTime.Location = CType(resources.GetObject("stbDateTime.Location"), System.Drawing.Point)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -