roadrunner
New member
- Joined
- Oct 31, 2006
- Messages
- 2
- Programming Experience
- Beginner
I was recently asked a multiple choice question: According to the sample code, which one of the following statements has NO effect and should be moved to another line to accomplish its purpose?
Code:
dim tb as New TextBox
g_row as Integer = 0
tb.Text = CType(g_row, String)
tb.Location = New Point(tb.Location.X, g_row * tb.Size.Height)
tb.BringToFront()
g_row += 1
Me.Listbox1.Parent.Controls.Add(tb)
A. g_row += 1
B. tb.BringToFront()
C. tb.Text = g_row
D. tb.Location = New Point(tb.Location.X, g_row * tb.Size.Height)
E. Me.Listbox1.Parent.Controls.Add(tb)
I don't know why C is there. What do you think the answer is and why?
Code:
dim tb as New TextBox
g_row as Integer = 0
tb.Text = CType(g_row, String)
tb.Location = New Point(tb.Location.X, g_row * tb.Size.Height)
tb.BringToFront()
g_row += 1
Me.Listbox1.Parent.Controls.Add(tb)
A. g_row += 1
B. tb.BringToFront()
C. tb.Text = g_row
D. tb.Location = New Point(tb.Location.X, g_row * tb.Size.Height)
E. Me.Listbox1.Parent.Controls.Add(tb)
I don't know why C is there. What do you think the answer is and why?