Unable to cast object of type 'System.String' to type 'System.Windows.Forms.TextBox'.
ayagi 0 Junior Poster
Recommended Answers
Jump to PostTextBox1 = ""
The above line will cause this error:
Value of type 'String' cannot be converted to 'System.Windows.Forms.TextBox'.
Can easily be fixed by setting the .Text of the TextBox as the String, and not the TextBox it's self.TextBox1.Text = ""
Without …
Jump to Post>>it says "Index was outside the bounds of the arrays"
This usually occurs when your (i) goes over the Array length/count.
.Here's an example.Try Dim arTemp() As String = {"one", "two", "three"} MsgBox(arTemp(3)) Catch ex As Exception MsgBox(ex.Message) End Try
Since Arrays start at 0 …
Jump to PostOk. With the above posted code, using
MsgBox(arTemp(0))
, you will get "one",MsgBox(arTemp(1))
will get you "two", andMsgBox(arTemp(2))
will get you "three" from the arTemp String Array.
.Since in my code I hadMsgBox(arTemp(3))
, that Array does not exist in arTemp, which should return a "four", therefore …
All 12 Replies
bLuEmEzzy 0 Junior Poster in Training
codeorder 197 Nearly a Posting Virtuoso
ayagi 0 Junior Poster
codeorder 197 Nearly a Posting Virtuoso
ayagi 0 Junior Poster
codeorder 197 Nearly a Posting Virtuoso
ayagi 0 Junior Poster
codeorder 197 Nearly a Posting Virtuoso
ayagi 0 Junior Poster
ayagi 0 Junior Poster
codeorder 197 Nearly a Posting Virtuoso
ayagi 0 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.