NSDCodabar メンバ

CODABAR(NW-7)のバーコードを出力します。


●表現可能なキャラクタ

すべて半角文字です。

表現可能なキャラクタ 説明
数字 0 〜 9
- マイナス
$ ドルマーク
/ スラッシュ
: コロン
+ プラス
. ピリオド、ドット

●コンストラクタ

名前 説明
NSDCodabar NSDCodabarを初期化します。

●プロパティの一覧

名前 説明
PicBox ピクチャーボックスを設定します。
DATAINFO CODABAR(NW-7)の描画情報の設定をします。
GUnit Print関数で指定するX座標,Y座標の単位を設定します。

●メソッドの一覧

名前 引数 戻り値 説明
Dispose なし なし リソースの解放を行います。
SetPicBoxBitmap ( [Integer], [Integer] ) Boolean型 ビットマップの幅、高さを指定しビットマップをセットします。
( Bitmap ) Boolean型 セットするビットマップを指定し、ビットマップをセットします。
GetStartStopCode ( NSD_NW7_START_STOP_CODE ) String型 スタート・ストップコードを返します。
GetCheckDegit ( String , NSD_NW7_CHECKDEGIT_STYLE ) String型 チェックデジットを返します。
Print ( Single, Single, String ) Boolean型 画面にバーコードを出力します。
( Single, Single, String , Bitmap ) Boolean型 指定したビットマップにバーコードを出力します。
( Single, Single, String , PrintPageEventArgs ) Boolean型 プリンターにバーコードを出力します。

●データ用クラスの一覧

名前:NSD_CODARBAR_INFO

構文:

Public Class NSD_CODARBAR_INFO
      Public Sng_Height As Single
      Public Int_Standard_Width As NSDBarcode.NSD_STANDARD_WIDTH
      Public Sng_AllWidth As Single
      Public Sng_NWRatio As Single
      Public Sng_NarrowLineWidth As Single
      Public Int_IntercharacterGap As Integer
      Public Bln_QuietZone As Boolean
      Public Bln_QuietZonePrint As Boolean
      Public QuiteZoneColor As System.Drawing.Color
      Public Bln_SourceCodePrint As Boolean
      Public Int_PrintNoStyle As NSD_NW7_PRINT_SOURCECODE_STYLE
      Public Int_SourceCodePrint_HoseiY As Integer
      Public Cls_Font As Font
      Public Bln_FontSize_Auto As Boolean
      Public Int_StartStopCodeNo As NSD_NW7_START_STOP_CODE
      Public Int_CheckDegit As NSD_NW7_CHECKDEGIT_STYLE
      Public Int_OneBarLineHoseiX As Integer
  End Class

内容:CODABAR(NW-7)の描画情報用クラス。

名前 説明
Sng_Height Single 高さ(mm)。 (既定値:11)
Int_Standard_Width NSDBarcode.NSD_STANDARD_WIDTH 幅の基準。 (既定値:NSDBarcode.NSD_STANDARD_WIDTH.NARROW_WIDTH)
Sng_AllWidth Single 全体幅(mm)。 (既定値:100)
Int_Standard_WidthがNSDBarcode.NSD_STANDARD_WIDTH.ALL_WIDTHの時に反映されます。
Sng_NWRatio Single Narrow(細)とWide(太)の比率(2〜3)。 (既定値:2.2)
Sng_NarrowLineWidth Single 細線の幅(mm)。 (既定値:0.2)
Int_Standard_WidthがNSDBarcode.NSD_STANDARD_WIDTH.NARROW_WIDTHの時に反映されます。
Int_IntercharacterGap Integer キャラクタ間ギャップの補正値。 (既定値:1)
Bln_QuietZone Boolean クワイエットゾーンの追加有無。
True :追加します。(既定値)
False:追加しません。
Bln_QuietZonePrint Boolean クワイエットゾーンの描画有無。
True :描画します。
False:描画しません。(既定値)
クワイエットゾーンの描画は範囲確認用(テスト用)で使用します。
実際の本番データを描画する場合は必ずFalseで行います。
QuiteZoneColor System.Drawing.Color クワイエットゾーンも含めた全体枠の描画色。 (既定値:Color.Blue)
Bln_SourceCodePrint Boolean コード文字の出力有無。
True :出力します。(既定値)
False:出力しません。
Int_PrintNoStyle NSD_NW7_PRINT_SOURCECODE_STYLE コード文字の出力位置。 (既定値:NSD_NW7_PRINT_SOURCECODE_STYLE.Barcode_Under)
Int_SourceCodePrint_HoseiY Integer コード文字出力時の補正値Y。 (既定値:1)
Cls_Font Font コード文字出力時のフォント。 (既定値:システムのフォント、フォントサイズ 8.25)
Bln_FontSize_Auto Boolean コード文字出力時のフォントサイズを自動調整。 (既定値:False)
Int_StartStopCodeNo NSD_NW7_START_STOP_CODE スタート・ストップコード。 (既定値:NSD_NW7_START_STOP_CODE.Code_a)
Int_CheckDegit NSD_NW7_CHECKDEGIT_STYLE チェックデジットのスタイル。(既定値:NSD_NW7_CHECKDEGIT_STYLE.STYLE_NOTHING)
Int_OneBarLineHoseiX Integer 1ライン描画後の補正値。 (既定値:0)

※ここで設定した高さ、細線の幅について出力時には最も近い数字(切り上げ)で丸められます。
全体幅については、出力時に幅を超えない最大の値が自動計算されます。
最も近い数字は出力デバイスの解像度によって変わります。


●定数の一覧

名前:NSD_NW7_CHECKDEGIT_STYLE チェックデジットスタイル
名前 内容
STYLE_NOTHING なし。
STYLE_MODULUS16 モジュラス16。
STYLE_7DR セブンチェック(余り)。
STYLE_7DSR セブンチェック(7から余りを引いた数)。

 

名前:NSD_NW7_START_STOP_CODE スタート・ストップコード
名前 内容
NotCode 指定しない
Code_a a
Code_b b
Code_c c
Code_d d

 

名前:NSD_NW7_PRINT_SOURCECODE_STYLE コード文字を出力するスタイル
名前 内容
Barcode_Top バーコードの上に出力。
Barcode_Under バーコードの下に出力。

●NSDCodabarコンストラクタの説明

構文:Public Sub New()

使用法:Dim Cls_BarcodeNW7 As New NSDCodabar

引数:なし。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As New NSDCodabar
        :
End Class

●NSDCodabarプロパティの説明

名前:PicBox

構文:Public Property PicBox() As PictureBox

機能:ピクチャーボックスを設定します。

Set値:ピクチャーボックスをセットします。

Get値:ピクチャーボックスを取得します。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

名前:DATAINFO

構文:Public Property DATAINFO() As NSD_CODARBAR_INFO

機能:CODABAR(NW-7)の描画情報の設定をします。

Set値:CODABAR(NW-7)の描画情報をセットします。

Get値:CODABAR(NW-7)の描画情報を取得します。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Cls_NW7_INFO.Bln_QuietZone = True
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_BarcodeNW7.Print( 10, 10, "0123456789")
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

名前:GUnit

構文:Public Property GUnit() As NSDBarcode.NSD_GRAPHICS_UNIT

機能:Print関数で指定するX座標,Y座標の単位を設定します。

Set値:座標の単位をセットします。

Get値:座標の単位を取得します。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Cls_NW7_INFO.Bln_QuietZone = True
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_BarcodeNW7.GUnit = NSDBarcode.NSD_GRAPHICS_UNIT.Millimeter
        Cls_BarcodeNW7.Print( 10, 10, "0123456789")
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

●NSDCodabarメソッドの説明

名前:Dispose
構文:Public Overridable Sub Dispose() Implements IDisposable.Dispose

機能:リソースを解放します。

※終了時に必ず呼び出します。

引数:なし。

戻り値:なし。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

名前:SetPicBoxBitmap
機能:ビットマップをセットします。

@ビットマップの幅、高さを指定しビットマップをセットします。

構文:Public Overloads Function SetPicBoxBitmap( [Width] , [Height] ) As Boolean

引数:

名前 引数渡しの方法 説明
[Width] Integer 値渡し(ByVal) ビットマップの幅を渡します。(既定値:0)
0または指定なしの場合は、ピクチャーボックスの幅が用いられます。
[Height] Integer 値渡し(ByVal) ビットマップの高さを渡します。(既定値:0)
0または指定なしの場合は、ピクチャーボックスの高さが用いられます。

戻り値:Boolean

戻り値の説明:

True:成功 、 False:失敗、エラー発生

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Cls_NW7_INFO.Bln_QuietZone = True
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_BarcodeNW7.Print( 10, 10, "0123456789")
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

Aセットするビットマップを指定し、ビットマップをセットします。

構文:Public Overloads Function SetPicBoxBitmap( Bmp ) As Boolean

引数:

名前 引数渡しの方法 説明
Bmp Bitmp 参照渡し(ByRef) セットするビットマップを渡します。

戻り値:Boolean

戻り値の説明:

True:成功 、 False:失敗、エラー発生

使用例:

Public Class Form1
    Dim Cls_PicBmp As Bitmap = Nothing
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_PicBmp = New Bitmap(Me.PictureBox1.Width, Me.PictureBox1.Height)
        Cls_BarcodeNW7.SetPicBoxBitmap(Cls_PicBmp)
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Cls_NW7_INFO.Bln_QuietZone = True
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.Print( 10, 10, "0123456789")
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing

        If Not (Cls_PicBmp Is Nothing) Then
            Cls_PicBmp.Dispose()
            Cls_PicBmp = Nothing
        End If
    End Sub
End Class

 

名前:GetStartStopCode
構文:Public Function GetStartStopCode( StartStopCodeNo ) As String

機能:スタート・ストップコードを返します。

引数:

名前 引数渡しの方法 説明
StartStopCodeNo NSD_NW7_START_STOP_CODE 値渡し(ByVal) スタート・ストップコードを渡します。

戻り値:String

戻り値の説明:

スタート・ストップコードを返します。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Dim Str_StartStopCode As String = _
            Cls_BarcodeNW7.GetStartStopCode(NSDCodabar.NSD_NW7_START_STOP_CODE.Code_a)
            :
        Cls_NW7_INFO.Int_StartStopCodeNo = NSDCodabar.NSD_NW7_START_STOP_CODE.NotCode
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.Print( 10, 10, Str_StartStopCode & "0123456789" & Str_StartStopCode)
            :
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

名前:GetCheckDegit
構文:Public Function GetCheckDegit( Code , Style ) As String

機能:チェックデジットを返します。

引数:

名前 引数渡しの方法 説明
Code String 値渡し(ByVal) チェックデジットなしのコードを渡します。
Style NSD_NW7_CHECKDEGIT_STYLE 値渡し(ByVal) チェックデジットのスタイルを渡します。

戻り値:String

戻り値の説明:

チェックデジットを返します。

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                           ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                               e As System.EventArgs _
                              ) Handles Button1.Click
            :
        Cls_NW7_INFO.Int_CheckDegit = NSD_NW7_CHECKDEGIT_STYLE.STYLE_NOTHING
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Dim Str_Code As String = "0123456789"
        Str_Code &= Cls_BarcodeNW7.GetCheckDegit(Str_Code, _
                                               NSD_NW7_CHECKDEGIT_STYLE.STYLE_MODULUS16)
        Cls_BarcodeNW7.Print( 10, 10, Str_Code)
            :
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                 ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

名前:Print
機能:バーコードを出力します。

@画面にバーコードを出力します。

構文:Public Function Print( X , Y , Code ) As Boolean

引数:

名前 引数渡しの方法 説明
X Single 値渡し(ByVal) 出力するX座標を渡します。
Y Integer 値渡し(ByVal) 出力するY座標を渡します。
Code String 値渡し(ByVal) 出力するコードを渡します。

戻り値:Boolean

戻り値の説明:

True:成功 、 False:失敗、エラー発生

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_BarcodeNW7.PicBox = Me.PictureBox1
        Cls_BarcodeNW7.SetPicBoxBitmap()
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
            :
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.Print( 10, 10, "0123456789")
            :
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

 

A指定したビットマップにバーコードを出力します。

構文:Public Function Print( X , Y , Code , Bmp ) As Boolean

引数:

名前 引数渡しの方法 説明
X Single 値渡し(ByVal) 出力するX座標を渡します。
Y Integer 値渡し(ByVal) 出力するY座標を渡します。
Code String 値渡し(ByVal) 出力するコードを渡します。
Bmp Bitmp 参照渡し(ByRef) 出力先のビットマップを渡します。

戻り値:Boolean

戻り値の説明:

True:成功 、 False:失敗、エラー発生

使用例:

Public Class Form1
    Dim Cls_PicBmp As Bitmap = Nothing
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_PicBmp = New Bitmap(100, 100)
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.Print( 10, 10, "0123456789", Cls_PicBmp)
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing

        If Not (Cls_PicBmp Is Nothing) Then
            Cls_PicBmp.Dispose()
            Cls_PicBmp = Nothing
        End If
    End Sub
End Class

 

Bプリンターにバーコードを出力します。

構文:Public Function Print( X , Y , Code , e ) As Boolean

引数:

名前 引数渡しの方法 説明
X Single 値渡し(ByVal) 出力するX座標を渡します。
Y Integer 値渡し(ByVal) 出力するY座標を渡します。
Code String 値渡し(ByVal) 出力するコードを渡します。
e PrintPageEventArgs 参照渡し(ByRef) PrintPageイベントのSystem.Drawing.Printing.PrintPageEventArgsを渡します。

戻り値:Boolean

戻り値の説明:

True:成功 、 False:失敗、エラー発生

使用例:

Public Class Form1
    Dim Cls_BarcodeNW7 As NSDCodabar = Nothing
    Dim Cls_NW7_INFO As NSDCodabar.NSD_CODARBAR_INFO = Nothing

    Private Sub Form1_Load( sender As System.Object, _
                            e As System.EventArgs _
                            ) Handles MyBase.Load
            :
        Cls_BarcodeNW7 = New NSDCodabar
        Cls_NW7_INFO = New NSDCodabar.NSD_CODARBAR_INFO
            :
    End Sub

    Private Sub Button1_Click( sender As System.Object, _
                                e As System.EventArgs _
                              ) Handles Button1.Click
        Me.PrintDocument1.Print()
    End Sub

    Private Sub PrintDocument1_PrintPage( ByVal sender As Object, _
                                          ByVal e As System.Drawing.Printing.PrintPageEventArgs _
                                          ) Handles PrintDocument1.PrintPage
        Cls_BarcodeNW7.DATAINFO = Cls_NW7_INFO
        Cls_BarcodeNW7.Print(10, 10, "0123456789", e)
        e.HasMorePages = False
    End Sub

    Private Sub Form1_FormClosed( sender As Object, _
                                  e As System.Windows.Forms.FormClosedEventArgs _
                                  ) Handles Me.FormClosed
        If Not (Cls_BarcodeNW7 Is Nothing) Then
            Cls_BarcodeNW7.Dispose()
            Cls_BarcodeNW7 = Nothing
        End If
        Cls_NW7_INFO = Nothing
    End Sub
End Class

Copyright (C) 2013 Nihon System Developer Corp. All Rights Reserved.