The whole concept of this project is whenever I enter the name of the shape, its
ID: 3702151 • Letter: T
Question
The whole concept of this project is whenever I enter the name of the shape, its sides and its figure must appear.
the problem is I want a code to remove the previous figure when I write the another name to make next figure appears clearly without overlapping with the last one
also I need to know where I could write it
Tools Test Analyze Window Help Any CPU orml.vb t ? tion 15 Form2.vb [Design) Form1.vb [Design] btnCheck Click myGraphics Graphics.Fromtwnd(picoutput.Handle) If txtinput-Text = "Circle" Then lblsides.Text "No Sides" myGraphics.Fillellipse (Brushes. Aqua, 10, 10, 100, 10e) ElseIf txtInput.Text "Triangle" Then lbisides . Text "Three sides'. myGraphics.FillPath(Brushes.Aqua, gp) myGraphics.DrawLines (Pens.Aqua, triangle) ElseIf txtInput.Text "Square" Then lblsides. Text "Four Sides" myRectangle New Rectangle(x:-10, y: -10, width:-100, height:-100) myGraphics. FillRectangle(Brushes.Aqua, rect:-myRectangle) Elself txtInput. Text -Pentagon Then 1blSides. Text -"Five Sides" myGraphics.FillPolygon (Brushes. Aqua, pentagon) Else MsgBox("You must enter the valid shape!") End If 0 MessanesExplanation / Answer
At the starting of if condition use Graphics.Clear Method (Color)
This method Clears the entire drawing surface and fills it with the specified background color.
For example
ElseIf txtInput.Text = "Triangle" Then
myGraphics.Clear(Color.Teal)
lblSides.Text = "Three sides"
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.