When I dynamically create a GroupBox
and add 4 RadionButton
s inside the GroupBox
it somehow puts the RadionButton
s behind the GroupBox
.
I have the code for the GroupBox
first therefore why do the RadionButton
s not show over the GroupBox
?
Code for reference:
multichoicegroupbox(Qnum) = New GroupBox : multichoicegroupbox(Qnum).Location = New Point(X, (Y - 5))
multichoicegroupbox(Qnum).Width = 230 : multichoicegroupbox(Qnum).Height = 120
frmQuizForStudents.Controls.Add(multichoicegroupbox(Qnum))
For MultichoiceCheckNum = 1 to 4
rdbmultichoice(MultichoiceCheckNum) = New RadioButton
rdbmultichoice(MultichoiceCheckNum).Location = New Point(multichoicegroupbox(Qnum).Location.X + 10,
(multichoicegroupbox(Qnum).Location.Y + (MultichoiceCheckNum * 24)))
rdbmultichoice(MultichoiceCheckNum).Font = New Font("Arial", 9)
rdbmultichoice(MultichoiceCheckNum).Text = multichoice(MultichoiceCheckNum)
multichoicegroupbox(Qnum).Controls.Add(rdbmultichoice(MultichoiceCheckNum))
Y += 24
Next MultichoiceCheckNum
When I comment out the New Point
line of code for the GroupBox
, the GroupBox
appears in the top left of the screen with all 4 RadionButton
s working on top of it.