none
宣言されていません。アクセスできない保護レベルになっています。 RRS feed

  • 質問

  • 下のやつの頭文字”g”が宣言されていません。アクセスできない保護レベルになっています。

    と表示されてしまいます。どうすればよいですか

    Public Class Form1


        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            g.FillRectangle(Brushes.Black, 300, 30, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 50, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 70, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 90, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 110, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 130, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 150, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 170, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 190, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 210, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 230, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 250, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 270, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 290, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 310, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 330, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 350, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 370, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 390, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 410, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 430, 20, 20)
            g.FillRectangle(Brushes.Black, 320, 450, 20, 20)
            g.FillRectangle(Brushes.Black, 300, 470, 20, 20)
            g.FillEllipse(Brushes.Red, 900, 280, 60, 60)
            g.FillRectangle(Brushes.Red, 800, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 800, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillEllipse(Brushes.Yellow, 900, 340, 60, 60)
            System.Threading.Thread.Sleep(1100)
            g.FillEllipse(Brushes.LightGreen, 900, 400, 60, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 800, 70, 100, 60)
            g.FillRectangle(Brushes.White, 800, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 770, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 770, 140, 100, 60)
            g.FillRectangle(Brushes.White, 900, 280, 60, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 770, 70, 100, 60)
            g.FillRectangle(Brushes.White, 770, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 735, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 765, 140, 100, 60)
            g.FillEllipse(Brushes.LightGreen, 880, 400, 60, 60)
            g.FillEllipse(Brushes.Yellow, 880, 340, 60, 60)
            g.FillEllipse(Brushes.Red, 880, 280, 60, 60)

            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 740, 70, 100, 60)
            g.FillRectangle(Brushes.White, 765, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 730, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 740, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 730, 70, 100, 60)
            g.FillRectangle(Brushes.White, 740, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 720, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 710, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 720, 70, 100, 60)
            g.FillRectangle(Brushes.White, 710, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 710, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 660, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 710, 70, 100, 60)
            g.FillRectangle(Brushes.White, 660, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 670, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 655, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 670, 70, 100, 60)
            g.FillRectangle(Brushes.White, 655, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 645, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 645, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 645, 70, 100, 60)
            g.FillRectangle(Brushes.White, 645, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 600, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 635, 140, 100, 60)
            System.Threading.Thread.Sleep(1000)
            g.FillRectangle(Brushes.White, 600, 70, 100, 60)
            g.FillRectangle(Brushes.White, 635, 140, 100, 60)
            g.FillRectangle(Brushes.Red, 580, 70, 100, 60)
            g.FillRectangle(Brushes.Blue, 570, 140, 100, 60)

        End Sub
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        End Sub
    End Class

    2019年5月14日 0:39

すべての返信