With this code i add the button to my form
but when i want to this, it won't do a thing:
--> Here is my problem:
<--
There ain't anything wrong with the function Vraag1()
VB.NET:
Function Knop1()
Dim Button1 AsNew Button
Button1.Location = New Point(30, 40)
Button1.Size = New Size(160, 24)
Button1.Text = "Klik hier voor vraag 1."
Me.Controls.Add(Button1)
EndFunction
--> Here is my problem:
VB.NET:
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Vraag1()
EndSub
VB.NET:
Function Vraag1()
Dim strVraag1 AsString
Dim strAntwoord1A AsString
Dim strAntwoord1B AsString
Dim strAntwoord1C AsString
Dim GroupBox1 AsNew GroupBox
Dim CheckBox1A AsNew CheckBox
Dim CheckBox1B AsNew CheckBox
Dim CheckBox1C AsNew CheckBox
strVraag1 = InputBox("Voer vraag " & intTeller & " in.", "Vraag " & intTeller)
strAntwoord1A = InputBox("Voer antwoord 1 in.", "Antwoord 1")
strAntwoord1B = InputBox("Voer antwoord 2 in.", "Antwoord 2")
strAntwoord1C = InputBox("Voer antwoord 3 in.", "Antwoord 3")
GroupBox1.Location = New Point(30, 40)
GroupBox1.Size = New Size(540, 100)
GroupBox1.Text = strVraag1
Me.Controls.Add(GroupBox1)
CheckBox1A.Size = New Size(95, 24)
CheckBox1A.Location = New Point(20, 12)
CheckBox1A.Text = strAntwoord1A
GroupBox1.Controls.Add(CheckBox1A)
'De checkbox aan de groupbox toevoegen.
CheckBox1B.Size = New Size(95, 24)
CheckBox1B.Location = New Point(20, 38)
CheckBox1B.Text = strAntwoord1B
GroupBox1.Controls.Add(CheckBox1B)
'De checkbox aan de groupbox toevoegen.
CheckBox1C.Size = New Size(95, 24)
CheckBox1C.Location = New Point(20, 66)
CheckBox1C.Text = strAntwoord1C
GroupBox1.Controls.Add(CheckBox1C)
'De checkbox aan de groupbox toevoegen.
EndFunction
There ain't anything wrong with the function Vraag1()
Last edited by a moderator: