Option Explicit On Option Strict On Imports System.Net Public Class Form1 Private Shadows Class Region Public Name As String Public Code() As Integer Sub New(ByVal Name As String, ByVal Code() As Integer) Me.Name = Name Me.Code = Code End Sub End Class Private Pref() As Region = {New Region("北海道", {1}), New Region("青森", {2}), New Region("岩手", {3}), New Region("宮城", {4}), New Region("秋田", {5}), New Region("山形", {6}), New Region("福島", {7}), New Region("茨城", {8}), New Region("栃木", {9}), New Region("群馬", {10}), New Region("埼玉", {11}), New Region("千葉", {12}), New Region("東京", {13}), New Region("神奈川", {14}), New Region("新潟", {15}), New Region("富山", {16}), New Region("石川", {17}), New Region("福井", {18}), New Region("山梨", {19}), New Region("長野", {20}), New Region("岐阜", {21}), New Region("静岡", {22}), New Region("愛知", {23}), New Region("三重", {24}), New Region("滋賀", {25}), New Region("京都", {26}), New Region("大阪", {27}), New Region("兵庫", {28}), New Region("奈良", {29}), New Region("和歌山", {30}), New Region("鳥取", {31}), New Region("島根", {32}), New Region("岡山", {33}), New Region("広島", {34}), New Region("山口", {35}), New Region("徳島", {36}), New Region("香川", {37}), New Region("愛媛", {38}), New Region("高知", {39}), New Region("福岡", {40}), New Region("佐賀", {41}), New Region("長崎", {42}), New Region("熊本", {43}), New Region("大分", {44}), New Region("宮崎", {45}), New Region("鹿児島", {46}), New Region("沖縄", {47})} Private Regions As New List(Of Region) Private PictureBox As New PictureBox With {.Dock = DockStyle.Fill, .SizeMode = PictureBoxSizeMode.Zoom} Private ToolStrip As New ToolStrip Private WithEvents TextBox As New ToolStripTextBox With {.AutoSize = False, .Width = 200} Private WithEvents Button As New ToolStripButton With {.Text = "塗る"} Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Regions.Add(New Region("北海道", {1})) Regions.Add(New Region("東北", {2, 3, 4, 5, 6, 7})) Regions.Add(New Region("関東", {8, 9, 10, 11, 12, 13, 14})) Regions.Add(New Region("中部", {15, 16, 17, 18, 19, 20, 21, 22, 23})) Regions.Add(New Region("関西", {24, 25, 26, 27, 28, 29, 30})) Regions.Add(New Region("中国", {31, 32, 33, 34, 35})) Regions.Add(New Region("四国", {36, 37, 38, 39})) Regions.Add(New Region("九州", {40, 41, 42, 43, 44, 45, 46})) Regions.Add(New Region("沖縄", {47})) Me.Size = New Size(800, 600) Me.ToolStrip.Items.AddRange({Me.TextBox, Me.Button}) Me.Controls.AddRange({Me.PictureBox, Me.ToolStrip}) Me.Button.PerformClick() Me.TextBox.TextBox.Select() End Sub