Option Strict On
Imports System.Xml
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms.Timer
Public Class Form2
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        ' この呼び出しは Windows フォーム デザイナで必要です。
        InitializeComponent()

        ' InitializeComponent() 呼び出しの後に初期化を追加します。

    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        MyBase.Dispose(disposing)
    End Sub

    ' メモ : 以下のプロシージャは、Windows フォーム デザイナで必要です。
    'Windows フォーム デザイナを使って変更してください。  
    ' コード エディタを使って変更しないでください。
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Timer1 As System.Windows.Forms.Timer
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
    Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents ComboBox4 As System.Windows.Forms.ComboBox
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
    Friend WithEvents Button2 As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Button1 = New System.Windows.Forms.Button
        Me.ComboBox1 = New System.Windows.Forms.ComboBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.Timer1 = New System.Windows.Forms.Timer
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.PictureBox2 = New System.Windows.Forms.PictureBox
        Me.ComboBox2 = New System.Windows.Forms.ComboBox
        Me.ComboBox3 = New System.Windows.Forms.ComboBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.Label7 = New System.Windows.Forms.Label
        Me.ComboBox4 = New System.Windows.Forms.ComboBox
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.Button2 = New System.Windows.Forms.Button
        '
        'Button1
        '
        Me.Button1.Font = New System.Drawing.Font("MS UI Gothic", 9.0!, System.Drawing.FontStyle.Regular)
        Me.Button1.Location = New System.Drawing.Point(40, 264)
        Me.Button1.Size = New System.Drawing.Size(48, 24)
        Me.Button1.Text = "選択"
        '
        'ComboBox1
        '
        Me.ComboBox1.Items.Add("1")
        Me.ComboBox1.Items.Add("2")
        Me.ComboBox1.Items.Add("3")
        Me.ComboBox1.Items.Add("4")
        Me.ComboBox1.Items.Add("5")
        Me.ComboBox1.Location = New System.Drawing.Point(40, 216)
        Me.ComboBox1.Size = New System.Drawing.Size(56, 20)
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(96, 224)
        Me.Label1.Size = New System.Drawing.Size(16, 16)
        Me.Label1.Text = "分"
        '
        'Timer1
        '
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("MS UI Gothic", 11.0!, System.Drawing.FontStyle.Bold)
        Me.Label2.ForeColor = System.Drawing.Color.Black
        Me.Label2.Size = New System.Drawing.Size(56, 16)
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("MS UI Gothic", 9.0!, System.Drawing.FontStyle.Bold)
        Me.Label3.ForeColor = System.Drawing.Color.Black
        Me.Label3.Location = New System.Drawing.Point(88, 0)
        Me.Label3.Size = New System.Drawing.Size(16, 16)
        Me.Label3.Text = "0"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.TopRight
        Me.Label3.Visible = False
        '
        'PictureBox2
        '
        Me.PictureBox2.Location = New System.Drawing.Point(0, 304)
        Me.PictureBox2.Size = New System.Drawing.Size(232, 26)
        '
        'ComboBox2
        '
        Me.ComboBox2.Items.Add("円")
        Me.ComboBox2.Items.Add("色棒")
        Me.ComboBox2.Location = New System.Drawing.Point(40, 240)
        Me.ComboBox2.Size = New System.Drawing.Size(56, 20)
        '
        'ComboBox3
        '
        Me.ComboBox3.Items.Add("赤")
        Me.ComboBox3.Items.Add("青")
        Me.ComboBox3.Location = New System.Drawing.Point(136, 216)
        Me.ComboBox3.Size = New System.Drawing.Size(48, 20)
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(184, 224)
        Me.Label4.Size = New System.Drawing.Size(16, 16)
        Me.Label4.Text = "色"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(96, 248)
        Me.Label5.Size = New System.Drawing.Size(16, 16)
        Me.Label5.Text = "形"
        '
        'Label6
        '
        Me.Label6.Font = New System.Drawing.Font("MS UI Gothic", 11.0!, System.Drawing.FontStyle.Bold)
        Me.Label6.ForeColor = System.Drawing.Color.Black
        Me.Label6.Location = New System.Drawing.Point(145, 0)
        Me.Label6.Size = New System.Drawing.Size(76, 16)
        Me.Label6.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(184, 248)
        Me.Label7.Size = New System.Drawing.Size(32, 16)
        Me.Label7.Text = "点滅"
        '
        'ComboBox4
        '
        Me.ComboBox4.Items.Add("あり")
        Me.ComboBox4.Items.Add("なし")
        Me.ComboBox4.Location = New System.Drawing.Point(136, 240)
        Me.ComboBox4.Size = New System.Drawing.Size(48, 20)
        '
        'PictureBox1
        '
        Me.PictureBox1.Location = New System.Drawing.Point(40, 24)
        Me.PictureBox1.Size = New System.Drawing.Size(160, 160)
        '
        'Label8
        '
        Me.Label8.Font = New System.Drawing.Font("ＭＳ Ｐゴシック", 12.0!, System.Drawing.FontStyle.Bold)
        Me.Label8.Location = New System.Drawing.Point(40, 192)
        Me.Label8.Size = New System.Drawing.Size(160, 18)
        Me.Label8.TextAlign = System.Drawing.ContentAlignment.TopCenter
        '
        'Button2
        '
        Me.Button2.Location = New System.Drawing.Point(96, 264)
        Me.Button2.Size = New System.Drawing.Size(48, 24)
        Me.Button2.Text = "中止"
        Me.Button2.Visible = False
        '
        'Form2
        '
        Me.ClientSize = New System.Drawing.Size(242, 336)
        Me.ControlBox = False
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.ComboBox4)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.Label5)
        Me.Controls.Add(Me.Label4)
        Me.Controls.Add(Me.ComboBox3)
        Me.Controls.Add(Me.ComboBox2)
        Me.Controls.Add(Me.PictureBox2)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.ComboBox1)
        Me.Controls.Add(Me.Button1)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Text = "実行中です，お待ちください．．．．．．．．．．"

    End Sub

#End Region
    Dim selectTime As Integer
    Dim myTimer As Timer
    Dim no As Integer
    Dim c_no As Integer
    Dim r_no As Integer

    Dim g As Graphics
    Dim colorg As Graphics
    Dim r1 As Rectangle
    Dim bmp As Bitmap
    Dim b, c As SolidBrush
    Dim secondInterval As Integer

    Dim selectColor As Color
    Dim timeCount As Integer
    Dim timeCount2 As Double
    Dim x As Integer

    Dim byou, byou2 As Integer
    Dim byouAmari As Double

    Dim circleBmp As Bitmap
    Dim circleGraphic As Graphics
    Dim c_r1 As Rectangle

    Public timeNo As Integer = 0
    Public check As Integer
    Dim blinkNo As Integer

    Dim Image_checkNo As Integer
 
    Dim myImage As Image

    '設定の継承用変数
    Dim selectFun As Integer
    Dim selectIro As Integer
    Dim selectType As Integer
    Dim selectBlink As Integer

    '一度に伸びるバーの幅
    Dim p_no As Integer
    Dim barPix As Integer

    'フォームが表示されたときの処理
    '■タイマー実行画面（メイン処理）
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.WindowState = FormWindowState.Maximized
        Image_checkNo = 0
        p_no = 0
        myTimer = New Timer
        myImage = New Bitmap("\Program Files\image160\" & showImage)
        PictureBox1.Image = myImage
        Label8.Text = selectTitle

        '各値の設定を読み込む
        If File.Exists("\Program Files\data\rainmanValueInfo.xml") = True Then
            Dim xReader As XmlTextReader = New XmlTextReader("\Program Files\data\rainmanValueInfo.xml")
            xReader.Read()
            xReader.Read()
            xReader.Read()
            xReader.Read()
            While xReader.Read
                If xReader.IsStartElement("分") = True Then
                    ComboBox1.SelectedIndex = Integer.Parse(xReader.ReadElementString)
                End If

                If xReader.IsStartElement("色") = True Then
                    ComboBox3.SelectedIndex = Integer.Parse(xReader.ReadElementString)
                End If

                If xReader.IsStartElement("形") = True Then
                    ComboBox2.SelectedIndex = Integer.Parse(xReader.ReadElementString)
                End If

                If xReader.IsStartElement("点滅") = True Then
                    ComboBox4.SelectedIndex = Integer.Parse(xReader.ReadElementString)
                End If
            End While
            xReader.Close()
        Else
            'コンボボックスの初期値
            ComboBox1.SelectedIndex = 0
            ComboBox2.SelectedIndex = 0
            ComboBox3.SelectedIndex = 0
            ComboBox4.SelectedIndex = 0
        End If
        blinkNo = 0

        timeCount = 0
        timeCount2 = 0

        check = 0
        x = 0

        Label2.Location = New Point(11, 2)
        Label6.Location = New Point(152, 2)

    End Sub


    '選択ボタンクリック
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        myImage.Dispose()
        myTimer.Enabled = False
        myTimer.Interval = 0
        myTimer.Dispose()
        ComboBox1.Enabled = False
        ComboBox2.Enabled = False
        ComboBox3.Enabled = False

        Button1.Visible = False

        myTimer.Enabled = False
        myTimer.Dispose()
        topSelectCheck = 3434
        Dim myForm1 As Form1 = New Form1
        myForm1.Show()
    End Sub

    '変数の初期化
    Sub VariableClear()
        timeCount = 0
        timeCount2 = 0
        byouAmari = 0
        selectTime = 0
        Label3.Text = "0"
        byou = 0
        byou2 = 0
        timeSet = Label2.Text
        endTime = Label6.Text
        MsgBox("Time Up!")
        topSelectCheck = 3434
        Dim myForm1 As Form1 = New Form1
        myForm1.Show()
    End Sub

    '一番最初の「円」を描く
    Function MakeBitmapCircleFirst(ByVal width As Integer, ByVal height As Integer) As Bitmap

        PictureBox2.Refresh()
        circleBmp = New Bitmap(232, 25)

        Dim c_Brush As New SolidBrush(selectColor)

        Dim c_p As New Pen(Color.Black)
        circleGraphic = Graphics.FromImage(circleBmp)

        With circleGraphic
            .FillRectangle(New SolidBrush(Color.White), 0, 0, 232, 25)
        End With

        For i As Integer = 0 To 9
            c_r1 = New Rectangle(0 + (i * 22), 0, 22, 22)
            circleGraphic.FillEllipse(c_Brush, c_r1)
            circleGraphic.DrawEllipse(c_p, c_r1)
        Next

        circleGraphic.Dispose()
        Return circleBmp
    End Function

    '円の内部を白に抜く処理
    Function MakeBitmapCircle(ByVal width As Integer, ByVal height As Integer) As Bitmap
        b = New SolidBrush(Color.White)
        c = New SolidBrush(selectColor)

        Dim c_Brush As New SolidBrush(Color.White)

        Dim c_p As New Pen(Color.Black)

        Dim fun As Integer = Integer.Parse(ComboBox1.Text)
        secondInterval = (fun * 60) * 1000

        byou = CInt(secondInterval / 10) * 1000
        byou2 = CInt((byou / 1000) / 1000)

        Dim amari, amari2 As Integer

        Dim i, j As Integer

        If timeCount > secondInterval / 1000 And timeCount2 > secondInterval / 1000 Then
            myTimer.Enabled = False
            c_no = 0

            'カウントダウンする秒数用変数
            amari = 0
            amari2 = 0

            Image_checkNo = 0
            VariableClear()
            myTimer.Dispose()
            circleGraphic.Dispose()
            'Exit Function
        Else
            amari = timeCount Mod 2
            amari2 = CInt(timeCount2 Mod byou2)
            '指定した分でマスを白に塗りつぶす間隔の設定
            Select Case amari
                Case 0
                    '点滅していないときの処理
                    c_r1 = New Rectangle(x, 0, 22, 22)

                    '点滅あり
                    If blinkNo = 0 Then
                        circleGraphic.FillEllipse(c, c_r1)
                    End If

                    If amari2 = 0 Then
                        circleGraphic.FillEllipse(b, c_r1)
                        x = 0 + (c_no * 22)
                        c_no = c_no + 1
                    End If
                Case Else
                    If blinkNo = 0 Then
                        c_r1 = New Rectangle(x, 0, 22, 22)
                        circleGraphic.FillEllipse(c_Brush, c_r1)
                    End If
            End Select
            timeCount = timeCount + 1
            timeCount2 = timeCount2 + 0.5

        End If
        circleGraphic.DrawEllipse(c_p, c_r1)

        byouAmari = timeCount2 Mod 1
        If byouAmari = 0 Then
            Label3.Text = (selectTime - timeCount2).ToString
            timeShow()
        End If
        Return circleBmp
    End Function

    Sub timeShow()
        Dim fun As Integer = CInt(Int(CType(Label3.Text, Integer) / 60))
        Dim byou As Integer = CType(Label3.Text, Integer) Mod 60
        Dim byouStr As String

        If byou < 10 Then
            byouStr = String.Format("0{0}", byou)
        Else
            byouStr = byou.ToString
        End If

        'カウントダウン用時刻の表示
        Label6.Text = fun.ToString & ":" & byouStr
    End Sub


    '*****************************//色つきプログレスバー//******************
    'いちばん最初に表示されている色棒の枠
    Function MakeColorProgressFirst(ByVal width As Integer, ByVal height As Integer) As Bitmap
        PictureBox2.Refresh()
        bmp = New Bitmap(183, 24)
        Dim p As New Pen(Color.Black)
        colorg = Graphics.FromImage(bmp)

        colorg.FillRectangle(New SolidBrush(selectColor), 0, 0, 182, 23)

        r1 = New Rectangle(0, 0, 182, 23)
        colorg.DrawRectangle(p, r1)

        colorg.Dispose()
        Return bmp
    End Function

    '色付きプログレスバーを白色で塗りつぶしていく処理
    Function MakeColorProgress(ByVal width As Integer, ByVal height As Integer) As Bitmap
        b = New SolidBrush(Color.White)
        Dim p As New Pen(Color.White)

        Dim fun As Integer = Integer.Parse(ComboBox1.Text)
        secondInterval = (fun * 60) * 1000

        barPix = 3
        If timeCount > secondInterval / 1000 And timeCount2 > secondInterval / 1000 Then
            myTimer.Enabled = False
            p_no = 0
            VariableClear()
            myTimer.Dispose()
            colorg.Dispose()
        Else
            barPix = 3
            If timeCount2 Mod fun = 0 Then
                r1 = New Rectangle(x + 1, 1, barPix, 21)
                colorg.FillRectangle(b, r1)
                x = 0 + (p_no * barPix)
                p_no = p_no + 1
            End If
            timeCount = timeCount + 1
            timeCount2 = timeCount2 + 0.5
        End If

        colorg.DrawRectangle(p, r1)

        byouAmari = timeCount2 Mod 1
        If byouAmari = 0 Then
            Label3.Text = (selectTime - timeCount2).ToString
            timeShow()
        End If
        Return bmp
    End Function


    Sub go()
        'ComboBox_VisibleTrue()

        'If ComboBox3.Text = String.Empty Then selectColor = Color.Red

        ComboBox_VisibleFalse()
        Label1.Visible = False
        Label4.Visible = False
        Label5.Visible = False
        Label7.Visible = False

        '分を秒に変換
        Select Case ComboBox1.Text
            Case "1"
                selectTime = 60
            Case "2"
                selectTime = 120
            Case "3"
                selectTime = 180
            Case "4"
                selectTime = 240
            Case "5"
                selectTime = 300
            Case Else
                selectTime = 0
        End Select
        Label3.Text = selectTime.ToString


        no = 0
        r_no = 0
        c_no = 0


        '初期の点滅の速度は0.5秒
        myTimer.Interval = 500
        myTimer.Enabled = True

        Select Case ComboBox2.Text
            Case "円"
                PictureBox2.Visible = True
                check = 1
                PictureBox2.Location = New Point(8, 290)
                AddHandler myTimer.Tick, AddressOf Timer1_TickCircle
                Me.PictureBox2.Image = MakeBitmapCircleFirst(Me.PictureBox1.Width, Me.PictureBox1.Height)
            Case "色棒"
                PictureBox2.Visible = True
                check = 2
                PictureBox2.Location = New Point(27, 290)
                AddHandler myTimer.Tick, AddressOf Timer1_ColorProgress
                Me.PictureBox2.Image = MakeColorProgressFirst(Me.PictureBox1.Width, Me.PictureBox1.Height)
            Case Else
                Exit Sub
        End Select
    End Sub

    '円タイマー処理
    Private Sub Timer1_TickCircle(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Select Case ComboBox2.Text
            Case "円"
                Me.PictureBox2.Image = MakeBitmapCircle(Me.PictureBox1.Width, Me.PictureBox1.Height)
        End Select
        timeNo = timeNo + 1
        Label2.Text = ComboBox1.Text & ":00"
    End Sub

    '色棒タイマー処理
    Private Sub Timer1_ColorProgress(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Select Case ComboBox2.Text
            Case "色棒"
                Me.PictureBox2.Image = MakeColorProgress(Me.PictureBox1.Width, Me.PictureBox1.Height)
        End Select
        Label2.Text = ComboBox1.Text & ":00"
    End Sub

    '「色」を選択
    Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
        Select Case ComboBox3.Text
            Case "赤"
                selectColor = Color.Red 'myColor(0)
            Case "青"
                selectColor = Color.Blue 'myColor(1)
        End Select
    End Sub
    '設定ボタンをクリックした時
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        PanelButtonNo = 0
        '設定ボタンがクリックされた時はタイマーシンボルと時間の表示は消す
        PictureBox2.Visible = False
        Label2.Visible = False
        Label6.Visible = False
        Button2.Visible = False
        ValueSetting()
    End Sub

    Sub ValueSetting()
        Image_checkNo = 0

        PictureBox1.Enabled = True

        Select Case Button2.Text
            Case "設定"
                ComboBox_VisibleTrue()

                '開始ボタンの使用不可

                Label1.Visible = True
                Label4.Visible = True
                Label5.Visible = True
                Label7.Visible = True

                myTimer.Interval = 0
                myTimer.Dispose()
                If check = 2 Then g.Dispose()
                If check = 1 Then circleGraphic.Dispose()
                If check = 2 Then colorg.Dispose()
                timeCount = 0
                timeCount2 = 0
                byou = 0
                byou2 = 0
                timeCount = 0
                timeCount2 = 0
                no = 0
                c_no = 0
                x = 0
                myTimer = New Timer
            Case Else
                Exit Sub
        End Select
    End Sub

    '「形」が選択されたときの処理
    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
        Select Case ComboBox2.Text
            Case "色棒"
                ComboBox4.SelectedIndex = 1
                ComboBox4.Enabled = False
            Case Else
                ComboBox4.SelectedIndex = 0
                ComboBox3.Enabled = True
                ComboBox4.Enabled = True
        End Select
    End Sub


    Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
        If ComboBox4.Text = "あり" Then
            blinkNo = 0
        Else
            blinkNo = 1
        End If
    End Sub


    '画像がクリックされタイマーが実行される
    Private Sub PictureBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        PanelButtonNo = 0
        Button1.Visible = False
        Button2.Visible = True
        Label2.Text = String.Empty
        Label6.Text = String.Empty
        Label2.Visible = True
        Label6.Visible = True
        PictureBox2.Visible = True
        LabelVisibleFalse()
        ComboBox_VisibleFalse()

        myTimer.Enabled = True

        '************//色棒の白塗りつぶしに重要な変数//*************
        p_no = 0

        '継承用の各値を変数に格納しておく
        selectFun = ComboBox1.SelectedIndex
        selectIro = ComboBox3.SelectedIndex
        selectType = ComboBox2.SelectedIndex
        selectBlink = ComboBox4.SelectedIndex

        '設定値の保存
        XmlValueSave()

        PictureBox1.Enabled = False
        Button1.Visible = False
        go()
    End Sub

    '中止ボタンをクリック
    Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        myTimer.Enabled = False
        MsgBox("「中止」されました。絵カード選択画面に戻ります！")
        topSelectCheck = 3434
        Dim myForm1 As Form1 = New Form1
        myForm1.Show()

    End Sub

    Sub ComboBox_VisibleFalse()
        ComboBox1.Visible = False
        ComboBox2.Visible = False
        ComboBox3.Visible = False
        ComboBox4.Visible = False
    End Sub

    Sub ComboBox_VisibleTrue()
        ComboBox1.Visible = True
        ComboBox2.Visible = True
        ComboBox3.Visible = True
        ComboBox4.Visible = True
    End Sub

    Sub LabelVisibleFalse()
        Label1.Visible = False
        Label4.Visible = False
        Label5.Visible = False
        Label7.Visible = False
    End Sub

    Sub LabelVisibleTrue()
        Label1.Visible = True
        Label4.Visible = True
        Label5.Visible = True
        Label7.Visible = True
    End Sub

    '設定値の保存処理
    Sub XmlValueSave()
        '選択された画像とタイトルをXMLファイルで保存する
        Dim xWriter As XmlTextWriter = Nothing
        xWriter = New XmlTextWriter("\Program Files\data\rainmanValueInfo.xml", System.Text.Encoding.GetEncoding("Shift_JIS"))
        With xWriter
            .Formatting = Formatting.Indented
            .Indentation = 3
            .WriteProcessingInstruction("xml", "version='1.0' encoding='Shift_JIS'")
            .WriteStartElement("全体")
            .WriteStartElement("情報")

            .WriteStartElement("分")
            .WriteString(selectFun.ToString)
            .WriteEndElement()

            .WriteStartElement("色")
            .WriteString(selectIro.ToString)
            .WriteEndElement()

            .WriteStartElement("形")
            .WriteString(selectType.ToString)
            .WriteEndElement()

            .WriteStartElement("点滅")
            .WriteString(selectBlink.ToString)
            .WriteEndElement()

            .WriteEndElement()
            .WriteEndElement()

            .Flush()
            .Close()
        End With
    End Sub

End Class

