|
分類:[.NET 全般]
'しつも〜ん '自分で調べるのは面倒くさいんで教えて!! 'あ、本を買うのも高いんで。 'X1,Y1--X2,Y2。 'このコードでは(0,0)-(100,30)の間の文字を1発で書く方法を教えて。
Option Strict On Option Explicit On 'Visual Basic 2010 Express Public Class Form1 Const moji_suu% = 3 Dim my_font1 As Font = New Font("ms uigothic", 10, FontStyle.Bold) Dim moji(moji_suu - 1) As String Dim moji_ichi(moji_suu - 1) As Drawing.Point Public Sub New() ' この呼び出しはデザイナーで必要です。 InitializeComponent() ' InitializeComponent() 呼び出しの後で初期化を追加します StartPosition = FormStartPosition.CenterScreen End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Height = 300 : Width = 300 BackColor = Color.White 'moji_data moji(0) = "家康の野望" moji(1) = "戦国1年 春" moji(2) = "ぽくぴの" 'moji_表示位置_data moji_ichi(0) = New Point(0, 0) moji_ichi(1) = New Point(20, 15) moji_ichi(2) = New Point(100, 30) End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim g As Graphics = e.Graphics For i = 0 To moji_suu - 1 g.DrawString(moji(i), my_font1, Brushes.Black, moji_ichi(i)) Next End Sub End Class
|