掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
画面のスクロール (ID:146145)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
これが完成品です Public Class Form1 Dim c As Integer Dim rn As Random = New Random Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.BackColor = Color.Black PictureBox1.Width = 1280 PictureBox1.Height = 1000 End Sub Private Sub PictureBox1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint Dim x As Integer, y As Integer For i As Integer = 0 To 999 x = rn.Next(999) y = rn.Next(999) Select Case rn.Next(4) Case 0 e.Graphics.FillEllipse(New SolidBrush(Color.Green), x, y, 3, 3) Case 1 e.Graphics.FillEllipse(New SolidBrush(Color.Red), x, y, 3, 3) Case 2 e.Graphics.FillEllipse(New SolidBrush(Color.Yellow), x, y, 3, 3) End Select Next c = 0 End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick PictureBox1.Top += 5 PictureBox1.Invalidate() If PictureBox1.Top > Me.Width - 1000 Then PictureBox1.Top = 0 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Enabled = Not Timer1.Enabled End Sub End Class
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.