Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Everyone

I am working on a project where I have to accept 5 text input from user on the inkcanvas and save the same.
The first input saves and can be retrieved properly. I face problem on retrieving the other inputs. On retrieving, the previous inputs also appear.

Before entering the input I clear the inkcanvas using the following code:
C#
this.inkCanv.Strokes.Clear();

But still the previous inputs appear on retrieving.

Although when I stop the application and start it again, the input is saved and retrieved in the correct manner.

What may be the issue??
How to clear the inkcanvas in the proper way.

Thanks in advance.
Posted
Updated 21-Nov-19 0:15am
v3

1 solution

You should use .RemoveAt

this.inkCanv.Strokes.Clear();

this.inkCanv.Strokes.RemoveAt(inkCanv.Strokes.Count - 1);



-Ozzy
 
Share this answer
 
Comments
Dave Kreskowiak 21-Nov-19 7:59am    
I doubt the OP is still looking for an answer 4 years later.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900