T
Thief_
I'm trying to create many squares on a form and for every new square, change
the background colour to the next colour. I'm trying to create a colour
palette showing all available colours and their colour name.
My problem is that I can not figger out how to create a new panel at
specific intervals across and down the form. Here's the code I have so far:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xNum As Byte = 4
Dim yNum As Byte = 2
Dim xLoc As Integer = 10
Dim yLoc As Integer = 10
Dim Spacer As Integer = 10
Dim ColourIndex As Object
Dim PanelHeight As Integer = 50
For y As Byte = 1 To yNum
For x As Byte = 1 To xNum
Dim NewPanelObj As New Panel
With NewPanelObj
.Left = xLoc
.Top = yLoc
.BackColor = CType(ColourIndex, Color)
xLoc += .Width + Spacer
End With
Next
yLoc += PanelHeight + Spacer
Next
End Sub
Can someone help me?
the background colour to the next colour. I'm trying to create a colour
palette showing all available colours and their colour name.
My problem is that I can not figger out how to create a new panel at
specific intervals across and down the form. Here's the code I have so far:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xNum As Byte = 4
Dim yNum As Byte = 2
Dim xLoc As Integer = 10
Dim yLoc As Integer = 10
Dim Spacer As Integer = 10
Dim ColourIndex As Object
Dim PanelHeight As Integer = 50
For y As Byte = 1 To yNum
For x As Byte = 1 To xNum
Dim NewPanelObj As New Panel
With NewPanelObj
.Left = xLoc
.Top = yLoc
.BackColor = CType(ColourIndex, Color)
xLoc += .Width + Spacer
End With
Next
yLoc += PanelHeight + Spacer
Next
End Sub
Can someone help me?