﻿Option Strict Off
Option Explicit On 
Imports System.Text
Friend Class Comp
    Inherits System.Windows.Forms.Form
#Region "Windows フォーム デザイナによって生成されたコード"
    Public Sub New()
        MyBase.New()
        If m_vb6FormDefInstance Is Nothing Then
            If m_InitializingDefInstance Then
                m_vb6FormDefInstance = Me
            Else
                Try
                    'スタートアップ フォームについては、最初に作成されたインスタンスが既定インスタンスになります。
                    If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
                        m_vb6FormDefInstance = Me
                    End If
                Catch
                End Try
            End If
        End If
        'この呼び出しは、Windows フォーム デザイナで必要です。
        InitializeComponent()
    End Sub
    'Form は、コンポーネント一覧に後処理を実行するために dispose をオーバーライドします。
    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
    'Windows フォーム デザイナで必要です。
    Private components As System.ComponentModel.IContainer
    Public ToolTip1 As System.Windows.Forms.ToolTip
    Public WithEvents Button_Cancel As System.Windows.Forms.Button
    Public WithEvents Button_OK As System.Windows.Forms.Button
    Public WithEvents Combo_Pulse As System.Windows.Forms.ComboBox
    Public WithEvents Label9 As System.Windows.Forms.Label
    Public WithEvents Frame2 As System.Windows.Forms.GroupBox
    Public WithEvents _Edit_Comp_7 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_6 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_5 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_4 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_3 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_2 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_1 As System.Windows.Forms.TextBox
    Public WithEvents _Edit_Comp_0 As System.Windows.Forms.TextBox
    Public WithEvents _Radio_Comp_1 As System.Windows.Forms.RadioButton
    Public WithEvents _Radio_Comp_0 As System.Windows.Forms.RadioButton
    Public WithEvents Label8 As System.Windows.Forms.Label
    Public WithEvents Label7 As System.Windows.Forms.Label
    Public WithEvents Label6 As System.Windows.Forms.Label
    Public WithEvents Label5 As System.Windows.Forms.Label
    Public WithEvents Label4 As System.Windows.Forms.Label
    Public WithEvents Label3 As System.Windows.Forms.Label
    Public WithEvents Label2 As System.Windows.Forms.Label
    Public WithEvents Label1 As System.Windows.Forms.Label
    Public WithEvents Frame1 As System.Windows.Forms.GroupBox
    'メモ : 以下のプロシージャは Windows フォーム デザイナで必要です。
    'Windows フォーム デザイナを使って変更できます。
    'コードエディタを使って修正しないでください。


    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Button_Cancel = New System.Windows.Forms.Button()
        Me.Button_OK = New System.Windows.Forms.Button()
        Me.Frame2 = New System.Windows.Forms.GroupBox()
        Me.Combo_Pulse = New System.Windows.Forms.ComboBox()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.Frame1 = New System.Windows.Forms.GroupBox()
        Me._Edit_Comp_7 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_6 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_5 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_4 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_3 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_2 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_1 = New System.Windows.Forms.TextBox()
        Me._Edit_Comp_0 = New System.Windows.Forms.TextBox()
        Me._Radio_Comp_1 = New System.Windows.Forms.RadioButton()
        Me._Radio_Comp_0 = New System.Windows.Forms.RadioButton()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Frame2.SuspendLayout()
        Me.Frame1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Button_Cancel
        '
        Me.Button_Cancel.BackColor = System.Drawing.SystemColors.Control
        Me.Button_Cancel.Cursor = System.Windows.Forms.Cursors.Default
        Me.Button_Cancel.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Button_Cancel.Location = New System.Drawing.Point(152, 328)
        Me.Button_Cancel.Name = "Button_Cancel"
        Me.Button_Cancel.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Button_Cancel.Size = New System.Drawing.Size(89, 20)
        Me.Button_Cancel.TabIndex = 13
        Me.Button_Cancel.Text = "ｷｬﾝｾﾙ"
        '
        'Button_OK
        '
        Me.Button_OK.BackColor = System.Drawing.SystemColors.Control
        Me.Button_OK.Cursor = System.Windows.Forms.Cursors.Default
        Me.Button_OK.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Button_OK.Location = New System.Drawing.Point(40, 328)
        Me.Button_OK.Name = "Button_OK"
        Me.Button_OK.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Button_OK.Size = New System.Drawing.Size(89, 20)
        Me.Button_OK.TabIndex = 12
        Me.Button_OK.Text = "OK"
        '
        'Frame2
        '
        Me.Frame2.BackColor = System.Drawing.SystemColors.Control
        Me.Frame2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Combo_Pulse, Me.Label9})
        Me.Frame2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame2.Location = New System.Drawing.Point(24, 264)
        Me.Frame2.Name = "Frame2"
        Me.Frame2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame2.Size = New System.Drawing.Size(233, 57)
        Me.Frame2.TabIndex = 11
        Me.Frame2.TabStop = False
        Me.Frame2.Text = "カウント一致パルス設定"
        '
        'Combo_Pulse
        '
        Me.Combo_Pulse.BackColor = System.Drawing.SystemColors.Window
        Me.Combo_Pulse.Cursor = System.Windows.Forms.Cursors.Default
        Me.Combo_Pulse.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.Combo_Pulse.ForeColor = System.Drawing.SystemColors.WindowText
        Me.Combo_Pulse.Location = New System.Drawing.Point(96, 24)
        Me.Combo_Pulse.Name = "Combo_Pulse"
        Me.Combo_Pulse.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Combo_Pulse.Size = New System.Drawing.Size(121, 21)
        Me.Combo_Pulse.TabIndex = 23
        '
        'Label9
        '
        Me.Label9.BackColor = System.Drawing.SystemColors.Control
        Me.Label9.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label9.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label9.Location = New System.Drawing.Point(32, 24)
        Me.Label9.Name = "Label9"
        Me.Label9.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label9.Size = New System.Drawing.Size(57, 17)
        Me.Label9.TabIndex = 22
        Me.Label9.Text = "パルス長："
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.AddRange(New System.Windows.Forms.Control() {Me._Edit_Comp_7, Me._Edit_Comp_6, Me._Edit_Comp_5, Me._Edit_Comp_4, Me._Edit_Comp_3, Me._Edit_Comp_2, Me._Edit_Comp_1, Me._Edit_Comp_0, Me._Radio_Comp_1, Me._Radio_Comp_0, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(24, 8)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(233, 249)
        Me.Frame1.TabIndex = 0
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "比較レジスタ設定"
        '
        '_Edit_Comp_7
        '
        Me._Edit_Comp_7.AcceptsReturn = True
        Me._Edit_Comp_7.AutoSize = False
        Me._Edit_Comp_7.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_7.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_7.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_7.Location = New System.Drawing.Point(96, 224)
        Me._Edit_Comp_7.MaxLength = 0
        Me._Edit_Comp_7.Name = "_Edit_Comp_7"
        Me._Edit_Comp_7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_7.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_7.TabIndex = 10
        Me._Edit_Comp_7.Text = "Text1"
        '
        '_Edit_Comp_6
        '
        Me._Edit_Comp_6.AcceptsReturn = True
        Me._Edit_Comp_6.AutoSize = False
        Me._Edit_Comp_6.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_6.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_6.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_6.Location = New System.Drawing.Point(96, 200)
        Me._Edit_Comp_6.MaxLength = 0
        Me._Edit_Comp_6.Name = "_Edit_Comp_6"
        Me._Edit_Comp_6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_6.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_6.TabIndex = 9
        Me._Edit_Comp_6.Text = "Text1"
        '
        '_Edit_Comp_5
        '
        Me._Edit_Comp_5.AcceptsReturn = True
        Me._Edit_Comp_5.AutoSize = False
        Me._Edit_Comp_5.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_5.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_5.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_5.Location = New System.Drawing.Point(96, 176)
        Me._Edit_Comp_5.MaxLength = 0
        Me._Edit_Comp_5.Name = "_Edit_Comp_5"
        Me._Edit_Comp_5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_5.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_5.TabIndex = 8
        Me._Edit_Comp_5.Text = "Text1"
        '
        '_Edit_Comp_4
        '
        Me._Edit_Comp_4.AcceptsReturn = True
        Me._Edit_Comp_4.AutoSize = False
        Me._Edit_Comp_4.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_4.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_4.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_4.Location = New System.Drawing.Point(96, 152)
        Me._Edit_Comp_4.MaxLength = 0
        Me._Edit_Comp_4.Name = "_Edit_Comp_4"
        Me._Edit_Comp_4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_4.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_4.TabIndex = 7
        Me._Edit_Comp_4.Text = "Text1"
        '
        '_Edit_Comp_3
        '
        Me._Edit_Comp_3.AcceptsReturn = True
        Me._Edit_Comp_3.AutoSize = False
        Me._Edit_Comp_3.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_3.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_3.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_3.Location = New System.Drawing.Point(96, 128)
        Me._Edit_Comp_3.MaxLength = 0
        Me._Edit_Comp_3.Name = "_Edit_Comp_3"
        Me._Edit_Comp_3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_3.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_3.TabIndex = 6
        Me._Edit_Comp_3.Text = "Text1"
        '
        '_Edit_Comp_2
        '
        Me._Edit_Comp_2.AcceptsReturn = True
        Me._Edit_Comp_2.AutoSize = False
        Me._Edit_Comp_2.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_2.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_2.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_2.Location = New System.Drawing.Point(96, 104)
        Me._Edit_Comp_2.MaxLength = 0
        Me._Edit_Comp_2.Name = "_Edit_Comp_2"
        Me._Edit_Comp_2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_2.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_2.TabIndex = 5
        Me._Edit_Comp_2.Text = "Text1"
        '
        '_Edit_Comp_1
        '
        Me._Edit_Comp_1.AcceptsReturn = True
        Me._Edit_Comp_1.AutoSize = False
        Me._Edit_Comp_1.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_1.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_1.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_1.Location = New System.Drawing.Point(96, 80)
        Me._Edit_Comp_1.MaxLength = 0
        Me._Edit_Comp_1.Name = "_Edit_Comp_1"
        Me._Edit_Comp_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_1.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_1.TabIndex = 4
        Me._Edit_Comp_1.Text = "Text1"
        '
        '_Edit_Comp_0
        '
        Me._Edit_Comp_0.AcceptsReturn = True
        Me._Edit_Comp_0.AutoSize = False
        Me._Edit_Comp_0.BackColor = System.Drawing.SystemColors.Window
        Me._Edit_Comp_0.Cursor = System.Windows.Forms.Cursors.IBeam
        Me._Edit_Comp_0.ForeColor = System.Drawing.SystemColors.WindowText
        Me._Edit_Comp_0.Location = New System.Drawing.Point(96, 56)
        Me._Edit_Comp_0.MaxLength = 0
        Me._Edit_Comp_0.Name = "_Edit_Comp_0"
        Me._Edit_Comp_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Edit_Comp_0.Size = New System.Drawing.Size(121, 18)
        Me._Edit_Comp_0.TabIndex = 3
        Me._Edit_Comp_0.Text = "Text1"
        '
        '_Radio_Comp_1
        '
        Me._Radio_Comp_1.BackColor = System.Drawing.SystemColors.Control
        Me._Radio_Comp_1.Cursor = System.Windows.Forms.Cursors.Default
        Me._Radio_Comp_1.ForeColor = System.Drawing.SystemColors.ControlText
        Me._Radio_Comp_1.Location = New System.Drawing.Point(96, 32)
        Me._Radio_Comp_1.Name = "_Radio_Comp_1"
        Me._Radio_Comp_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Radio_Comp_1.Size = New System.Drawing.Size(65, 17)
        Me._Radio_Comp_1.TabIndex = 2
        Me._Radio_Comp_1.TabStop = True
        Me._Radio_Comp_1.Text = "16進数"
        '
        '_Radio_Comp_0
        '
        Me._Radio_Comp_0.BackColor = System.Drawing.SystemColors.Control
        Me._Radio_Comp_0.Cursor = System.Windows.Forms.Cursors.Default
        Me._Radio_Comp_0.ForeColor = System.Drawing.SystemColors.ControlText
        Me._Radio_Comp_0.Location = New System.Drawing.Point(96, 16)
        Me._Radio_Comp_0.Name = "_Radio_Comp_0"
        Me._Radio_Comp_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._Radio_Comp_0.Size = New System.Drawing.Size(65, 17)
        Me._Radio_Comp_0.TabIndex = 1
        Me._Radio_Comp_0.TabStop = True
        Me._Radio_Comp_0.Text = "10進数"
        '
        'Label8
        '
        Me.Label8.BackColor = System.Drawing.SystemColors.Control
        Me.Label8.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label8.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label8.Location = New System.Drawing.Point(32, 224)
        Me.Label8.Name = "Label8"
        Me.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label8.Size = New System.Drawing.Size(49, 17)
        Me.Label8.TabIndex = 21
        Me.Label8.Text = "ﾁｬﾈﾙ7"
        '
        'Label7
        '
        Me.Label7.BackColor = System.Drawing.SystemColors.Control
        Me.Label7.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label7.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label7.Location = New System.Drawing.Point(32, 200)
        Me.Label7.Name = "Label7"
        Me.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label7.Size = New System.Drawing.Size(41, 17)
        Me.Label7.TabIndex = 20
        Me.Label7.Text = "ﾁｬﾈﾙ6"
        '
        'Label6
        '
        Me.Label6.BackColor = System.Drawing.SystemColors.Control
        Me.Label6.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label6.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label6.Location = New System.Drawing.Point(32, 176)
        Me.Label6.Name = "Label6"
        Me.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label6.Size = New System.Drawing.Size(49, 17)
        Me.Label6.TabIndex = 19
        Me.Label6.Text = "ﾁｬﾈﾙ5"
        '
        'Label5
        '
        Me.Label5.BackColor = System.Drawing.SystemColors.Control
        Me.Label5.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label5.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label5.Location = New System.Drawing.Point(32, 152)
        Me.Label5.Name = "Label5"
        Me.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label5.Size = New System.Drawing.Size(57, 17)
        Me.Label5.TabIndex = 18
        Me.Label5.Text = "ﾁｬﾈﾙ4"
        '
        'Label4
        '
        Me.Label4.BackColor = System.Drawing.SystemColors.Control
        Me.Label4.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label4.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label4.Location = New System.Drawing.Point(32, 128)
        Me.Label4.Name = "Label4"
        Me.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label4.Size = New System.Drawing.Size(49, 17)
        Me.Label4.TabIndex = 17
        Me.Label4.Text = "ﾁｬﾈﾙ3"
        '
        'Label3
        '
        Me.Label3.BackColor = System.Drawing.SystemColors.Control
        Me.Label3.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label3.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label3.Location = New System.Drawing.Point(32, 104)
        Me.Label3.Name = "Label3"
        Me.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label3.Size = New System.Drawing.Size(49, 17)
        Me.Label3.TabIndex = 16
        Me.Label3.Text = "ﾁｬﾈﾙ2"
        '
        'Label2
        '
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(32, 80)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(41, 17)
        Me.Label2.TabIndex = 15
        Me.Label2.Text = "ﾁｬﾈﾙ1"
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label1.Location = New System.Drawing.Point(32, 56)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(41, 17)
        Me.Label1.TabIndex = 14
        Me.Label1.Text = "ﾁｬﾈﾙ0"
        '
        'Comp
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(276, 370)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button_Cancel, Me.Button_OK, Me.Frame2, Me.Frame1})
        Me.Location = New System.Drawing.Point(4, 23)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Comp"
        Me.Text = "比較設定"
        Me.Frame2.ResumeLayout(False)
        Me.Frame1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
#End Region
#Region "アップグレード ウィザードのサポート コード"
    Private Shared m_vb6FormDefInstance As Comp
    Private Shared m_InitializingDefInstance As Boolean
    Public Shared Property DefInstance() As Comp
        Get
            If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
                m_InitializingDefInstance = True
                m_vb6FormDefInstance = New Comp()
                m_InitializingDefInstance = False
            End If
            DefInstance = m_vb6FormDefInstance
        End Get
        Set(ByVal Value As Comp)
            m_vb6FormDefInstance = Value
        End Set
    End Property
#End Region
    Dim Ret As Short                            ' 戻り値
    Dim szError As New StringBuilder("", 256)          ' エラー文字列
    Dim szReturnCode As New String("", 256)     ' 表示エラー文字列

    Dim szText As New String("", 100)           ' テンポラリ文字列

    Dim CompValue() As Integer = {100, 200, 300, 400, 500, 600, 700, 800}        ' 比較値
    Dim PulseWidth As Short                     ' パルス長

    Dim Edit_Comp(7) As TextBox

    '---------------------------------------------------------
    ' ダイアログ初期化
    '---------------------------------------------------------
    Private Sub Comp_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

        ' 画面アイテムの初期化
        Dim i As Short
        Dim ChNo As Short

        Edit_Comp(0) = _Edit_Comp_0
        Edit_Comp(1) = _Edit_Comp_1
        Edit_Comp(2) = _Edit_Comp_2
        Edit_Comp(3) = _Edit_Comp_3
        Edit_Comp(4) = _Edit_Comp_4
        Edit_Comp(5) = _Edit_Comp_5
        Edit_Comp(6) = _Edit_Comp_6
        Edit_Comp(7) = _Edit_Comp_7

        PulseWidth = 0

        _Radio_Comp_0.Checked = True

        For i = 0 To 7
            ' 比較値を符号無しで表示するため、一度16進文字例変換を経由
            szText = Str(Convert.ToUInt32(Hex(CompValue(i)), 16))
            Edit_Comp(i).Text = szText
            If (i >= ChannelNum) Then
                Edit_Comp(i).Enabled = False
            End If
        Next i

        For i = 0 To &HFS
            szText = Hex(i)
            Combo_Pulse.Items.Add((szText))
        Next i

        ' 設定値取得
        ChNo = 0
        Call CntGetPulseWidth(Id, ChNo, PulseWidth)
        Combo_Pulse.SelectedIndex = PulseWidth

    End Sub

    '---------------------------------------------------------
    ' OKボタンの処理
    '---------------------------------------------------------
    Private Sub Button_OK_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_OK.Click

        Dim i As Short

        ' 画面から設定値取得
        For i = 0 To 7
            szText = Edit_Comp(i).Text
            If _Radio_Comp_0.Checked = True Then
                ' 比較値を符号ありで設定するため、一度16進文字例変換を経由
                CompValue(i) = Convert.ToInt32(Hex(Val(szText)), 16)
            Else
                CompValue(i) = Val("&H" & szText)
            End If
        Next i

        szText = Combo_Pulse.Text
        PulseWidth = Val("&H" & szText)

        ' 各チャネル毎に
        For i = 0 To ChannelNum - 1

            ' 比較値設定
            Ret = CntNotifyCountUp(Id, i, 0, CompValue(i), Counter.DefInstance.Handle.ToInt32)

            ' エラー処理
            If (Ret <> CNT_ERR_SUCCESS) Then
                Call CntGetErrorString(Ret, szError)
                szReturnCode = "CntNotifyCountUp : Ret = " & Ret & ":" & szError.ToString()
                MsgBox(szReturnCode, MsgBoxStyle.OKOnly, "エラー")
                Exit For
            End If

            ' パルス長設定
            Ret = CntSetPulseWidth(Id, i, PulseWidth)

            ' エラー処理
            If (Ret <> CNT_ERR_SUCCESS) Then
                Call CntGetErrorString(Ret, szError)
                szReturnCode = "CntSetPulseWidth : Ret = " & Ret & ":" & szError.ToString()
                MsgBox(szReturnCode, MsgBoxStyle.OKOnly, "エラー")
                Exit For
            End If
        Next i

        Me.Close()

    End Sub

    '---------------------------------------------------------
    ' キャンセルボタンの処理
    '---------------------------------------------------------
    Private Sub Button_Cancel_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Button_Cancel.Click

        Me.Close()

    End Sub

    '---------------------------------------------------------
    ' 比較値の表示変更
    '---------------------------------------------------------
    '10進数
    Private Sub _Radio_Comp_0_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _Radio_Comp_0.CheckedChanged
        '画面情報を更新
        Dim i As Short

        For i = 0 To 7
            ' 比較値を符号無しで表示するため、一度16進文字例変換を経由
            szText = Str(Convert.ToUInt32(Hex(CompValue(i)), 16))
            Edit_Comp(i).Text = szText
        Next i

    End Sub

    '16進数
    Private Sub _Radio_Comp_1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _Radio_Comp_1.CheckedChanged
        '画面情報を更新
        Dim i As Short

        For i = 0 To 7
            szText = Hex(CompValue(i))                  '---------"%08X"
            Edit_Comp(i).Text = szText
        Next i

    End Sub

End Class