返回列表 上一主題 發帖

[發問] 請教 元件陣列(Array)後的 命名疑惑

[發問] 請教 元件陣列(Array)後的 命名疑惑

Public Class Form1
    Dim chbo(10, 10) As CheckBox

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim usx As Integer
        Dim usy As Integer
        Dim nn As Integer
        Dim fontFamily As New FontFamily("微軟正黑體")
        Me.Show()
        nn = 1
        For uux = 1 To 1300 Step 50
            For uuy = 1 To 600 Step 140

                For usx = 0 To 5
                    For usy = 0 To 5

                        chbo(usx, usy) = New CheckBox
                        chbo(usx, usy).BackColor = Color.Aquamarine
                        chbo(usx, usy).Width = 40
                        chbo(usx, usy).Height = 130

                        chbo(usx, usy).Location = New Point(10 + usx + uux, 10 + usy + uuy)

                        Me.Controls.Add(chbo(usx, usy))
                        chbo(usx, usy).Text = chbo(usx, usy).Name & nn  '這邊的 .Name 怎無法顯示

                    Next
                Next
                nn = nn + 1
            Next
        Next

    End Sub
End Class

  多做多想多學習,少看少錯少迷途

  多做=多多練習,多多編寫。
  多想=想想為什麼人家程式要那樣寫,如果換成自己,又會怎寫。
  多學習=學習人家的發問並解答,學習人家的寫法

  少看=只看不做也枉然

        靜思自在 : 人的眼睛長在前面,只看到別人的缺點,絲毫看不到自己的缺點。
返回列表 上一主題