綾の記憶
miou1116
暱稱: Miou綾
性別: 男
國家: 澳門
地區: 風順堂區
« June 2026 »
SMTWTFS
123456
78910111213
14151617181920
21222324252627
282930
最新文章
2011-03-17
VB
Start of tHe PianO l...
VB
完滿的生日-V-
每月文章
好友名單
最近訪客
最近沒有訪客
2011 年 1 月 6 日  星期四   晴天


VB 分類: 未分類

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PrintPreviewDialog1.Document = PrintDocument1
        PrintDialog1.Document = PrintDocument1
    End Sub

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Randomize()
        Dim count(25) As Integer
        Dim MyGraphics As Graphics = e.Graphics
        Dim MyPen1 As New Pen(Color.Blue, 1)
        Dim MyPen2 As New Pen(Color.Red, 1)
        Dim MyFont As New Font("標階體", 20)
        Dim MyFont2 As New Font("標階體", 10)
        Dim MyBrush As New SolidBrush(Color.Blue)
        Dim ans As String = ""
        Dim i, j As Integer
        For i = 1 To 25
            count(i) = Int(Rnd() * 61) + 40
        Next
        For i = 1 To 6
            MyGraphics.DrawLine(MyPen1, 50, i * 50, 300, i * 50)
            MyGraphics.DrawLine(MyPen1, i * 50, 50, i * 50, 300)
        Next
        For i = 1 To 5
            For j = 1 To 5
                MyGraphics.DrawString((i - 1) * 5 + j, MyFont, MyBrush, i * 50 + i, j * 50)
                If count((i - 1) * 5 + j) < 60 Then
                    MyGraphics.DrawEllipse(MyPen2, i * 50, j * 50, 50, 50)
                End If
            Next
        Next
        For i = 1 To 25
            ans = ans & count(i) & ","
        Next
        MyGraphics.DrawString(ans, MyFont2, MyBrush, 50, 310)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        PrintPreviewDialog1.ShowDialog()
    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        Dim MyGraphics As Graphics = e.Graphics
        Dim MyPen1 As New Pen(Color.Blue, 1)
        Dim MyFont As New Font("標階體", 20)
        Dim MyBrush As New SolidBrush(Color.Blue)

        Dim i, j As Integer
        Dim count As Integer = 0
        For i = 1 To 6
            MyGraphics.DrawLine(MyPen1, 50, i * 50, 300, i * 50)
            MyGraphics.DrawLine(MyPen1, i * 50, 50, i * 50, 300)
        Next
        For i = 1 To 5
            For j = 1 To 5
                MyGraphics.DrawString((i - 1) * 5 + j, MyFont, MyBrush, i * 50 + i, j * 50 + i)
            Next
        Next

    End Sub
End Class






訪客留言 (返回 miou1116 的日誌)

訪客名稱:
電郵地址: (不會公開)
驗證碼:  按此更新驗證碼 (如看不清楚驗證碼請點擊圖片刷新)
俏俏話: (必需 登入 後才能使用此功能)
[ 開啟多功能編輯器 ]