Hello, I am not asking for someone to complete this for me..I am just asking for advice and or guidance on how to get this to work.
I am stuck on how I go about using the nested for loops.
Thanks in advance for any help.
Here is what I am trying to accomplish:
Step 4: Add code in the Draw button’s Click event to create the number of rows and columns selected, using the character selected
Use nested For loops to create the rectangle of characters based on the user selections. The outer loop will control the number of rows. Use the value selected in the Rows combo to determine the stopping value of the outer loop. Use the value selected in the Columns combo to determine the stopping value of the inner loop, which controls the number of characters per line.
Here Is my Code:
I am stuck on how I go about using the nested for loops.
Thanks in advance for any help.
Here is what I am trying to accomplish:
Step 4: Add code in the Draw button’s Click event to create the number of rows and columns selected, using the character selected
Use nested For loops to create the rectangle of characters based on the user selections. The outer loop will control the number of rows. Use the value selected in the Rows combo to determine the stopping value of the outer loop. Use the value selected in the Columns combo to determine the stopping value of the inner loop, which controls the number of characters per line.
Here Is my Code:
VB.NET:
Public Class MainForm
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cb_Rows.Items.Add(1)
cb_Rows.Items.Add(2)
cb_Rows.Items.Add(3)
cb_Rows.Items.Add(4)
cb_Rows.Items.Add(5)
cb_Rows.Items.Add(6)
cb_Rows.Items.Add(7)
cb_Rows.Items.Add(8)
cb_Rows.Items.Add(9)
cb_Columns.Items.Add(1)
cb_Columns.Items.Add(2)
cb_Columns.Items.Add(3)
cb_Columns.Items.Add(4)
cb_Columns.Items.Add(5)
cb_Columns.Items.Add(6)
cb_Columns.Items.Add(7)
cb_Columns.Items.Add(8)
cb_Columns.Items.Add(9)
cb_Character.Items.Add("*")
cb_Character.Items.Add("$")
cb_Character.Items.Add("@")
cb_Character.Items.Add("%")
End Sub
Private Sub btn_Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Exit.Click
Me.Close()
End Sub
Private Sub btn_Clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Clear.Click
txt_TextBox.Clear()
cb_Character.Text = ""
cb_Columns.Text = ""
cb_Rows.Text = ""
End Sub
Private Sub btn_Draw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Draw.Click
Dim rows As Integer
Dim columns As Integer
Dim character As String
rows = cb_Rows.Text
columns = cb_Columns.Text
character = cb_Character.Text
End Sub
End Class