English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Public Class Form1

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

End Sub
End Class
Public Class ColorsForm

'program Colors on page 324. Needs to create an array with upper bound of 50 and then increase the size of the array

' by 10 elements whenever it runs out of space to store the colors.

' Need to figure out how to increase the size of the array when the program is reading a file and runs out of room

Dim Colors(50) As String

Dim reccount As Integer

Private Sub ColorsForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim i As Integer = -1

Dim sr As IO.StreamReader = IO.File.OpenText("c:\DOCUMENTS and Settings\COLORS.txt")

Do While (sr.Peek <> -1)

i += 1

Colors(i) = sr.ReadLine

Loop

sr.Close()

End Sub

Private Sub btnColors_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnColors.click

lstColors.Items.Clear()


For i As Integer = 0 To 50

If (Colors(i).Substring(0, 1) = txtState.Text) Then

lstColors.Items.Add(Colors(i))

End If

Next

End Sub



End Class

2007-11-25 00:21:30 · 1 answers · asked by Tyna 1 in Computers & Internet Programming & Design

1 answers

It appears that you have two End Class statements for your forms code.

Public Class Form1

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

End Sub
End Class '****** this should be the last line
Public Class ColorsForm


Also you should place your variable declarations immediately after "Public Class Form1" followed by Subs and Functions.

2007-11-25 00:36:30 · answer #1 · answered by MarkG 7 · 0 0

fedest.com, questions and answers