掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
文字列を指定範囲内に中央揃えで印刷したい (ID:138656)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
http://msdn2.microsoft.com/ja-jp/library/332kzs7c(VS.80).aspx に以下のコードがありましたので使えそうです。 ありがとうございました。 Dim text1 As String = "Use StringFormat and Rectangle objects to" & _ " center text in a rectangle." Dim font1 As New Font("Arial", 12, FontStyle.Bold, GraphicsUnit.Point) Try Dim rect1 As New Rectangle(10, 10, 130, 140) ' Create a StringFormat object with the each line of text, and the block ' of text centered on the page. Dim stringFormat As New StringFormat() stringFormat.Alignment = StringAlignment.Center stringFormat.LineAlignment = StringAlignment.Center ' Draw the text and the surrounding rectangle. e.Graphics.DrawString(text1, font1, Brushes.Blue, rect1, stringFormat) e.Graphics.DrawRectangle(Pens.Black, rect1) Finally font1.Dispose() End Try
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.