I Put together this bit of code. What the problem im having is Removing a Label after i place the code its in a select end slecte code . The Problem is in red.
the code
Code:Dim Animals As String = (TextBox1.Text) Select Case Animals Case "Apples" Dim userinput1 As Integer = InputBox("Enter The Farm X Location") Dim userinput2 As Integer = InputBox("Enter The Farm Y Location") Dim userinput3 As Integer = InputBox("Enter The Farm Widgth Size") Dim userinput4 As Integer = InputBox("Enter The Farm Hidgth Size") Dim userinput5 As String = InputBox("Please Choose Farm Name") Dim LB As New Label() LB.Name = userinput5 Me.Controls.Add(LB) LB.Location = New Point(userinput1, userinput2) LB.Size = New Size(userinput3, userinput4) LB.BackColor = Color.Red LB.Text = "Apples" Case "Sell" Dim userinput1 As String = InputBox("Please Choose A Orchard To Sell") Dim LB As New Label() Me.Controls.Remove(LB) LB.Name = userinput1 End Select
Everything works Accept the remove selection ... I think it has something to do with Dim LB As New Label() ... And ... Me.Controls.Remove(LB)




Reply With Quote