1 2 3 4 5 6 7 8 | Dim instance As ClientHwnd Dim s As String '描画する文字列 Dim font As System.Drawing.Font '文字列のテキスト形式を定義するFontオブジェクト Dim brush As System.Drawing.Brush '描画するテキストの色とテクスチャを決定するBrushオブジェクト Dim pt As System.Drawing.Point '描画するテキストの左上隅の座標を表すPointオブジェクト 'Overloads instance.DrawStringClient(s, font, brush, pt) |
1 2 3 4 5 6 7 8 9 | Dim instance As ClientHwnd Dim s As String '描画する文字列 Dim font As System.Drawing.Font '文字列のテキスト形式を定義するFontオブジェクト Dim brush As System.Drawing.Brush '描画するテキストの色とテクスチャを決定するBrushオブジェクト Dim x As Integer '描画するテキストの左上隅のX座標 Dim y As Integer '描画するテキストの左上隅のY座標 'Overloads instance.DrawStringClient(s, font, brush, x, y) |
1 2 3 4 5 6 7 8 9 | Dim instance As ClientHwnd Dim s As String '描画する文字列 Dim font As System.Drawing.Font '文字列のテキスト形式を定義するFontオブジェクト Dim brush As System.Drawing.Brush '描画するテキストの色とテクスチャを決定するBrushオブジェクト Dim pt As System.Drawing.Point '描画するテキストの左上隅の座標を表すPointオブジェクト Dim format As System.Drawing.StringFormat '行間や配置などの書式属性を指定するStringFormat 'Overloads instance.DrawStringClient(s, font, brush, pt, format) |
1 2 3 4 5 6 7 8 9 10 | Dim instance As ClientHwnd Dim s As String '描画する文字列 Dim font As System.Drawing.Font '文字列のテキスト形式を定義するFontオブジェクト Dim brush As System.Drawing.Brush '描画するテキストの色とテクスチャを決定するBrushオブジェクト Dim x As Integer '描画するテキストの左上隅のX座標 Dim y As Integer '描画するテキストの左上隅のY座標 Dim format As System.Drawing.StringFormat '行間や配置などの書式属性を指定するStringFormat 'Overloads instance.DrawStringClient(s, font, brush, x, y, format) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 'ClientHwndクラス DrawStringClientメソッド Imports Microsoft.VisualBasic Imports System.Windows.Forms Imports System.Drawing Public Class AddIn Public Sub AddIn_Start() Dim chw As ClientHwnd = New ClientHwnd() Dim fnt As New Font( "MS UI Gothic" , 12) chw.DrawStringClient( "あいうえお" , fnt, Brushes.Blue, New Point(50, 30)) chw.DrawStringClient( "ABCDEFF亜居宇絵御" , fnt, Brushes.Red, 50, 60) Dim sf As StringFormat = New StringFormat() sf.FormatFlags = StringFormatFlags.DirectionVertical '縦書きにする chw.DrawStringClient( "あいうえお" , fnt, Brushes.Green, New Point(300, 30), sf) fnt = New Font( "@MS ゴシック" , 12) sf.FormatFlags = StringFormatFlags.DirectionVertical _ Or StringFormatFlags.DirectionRightToLeft '縦書き、右から左へ Dim str As String = "ABCDEFF亜居宇絵御" & ControlChars.CrLf _ & "かきくけこghijklmn" & ControlChars.CrLf & "1234567890" chw.DrawStringClient(str, fnt, Brushes.Purple, 400, 60, sf) sf.Dispose() fnt.Dispose() End Sub End Class |