|
| | |||||||
| Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications. |
| | LinkBack | Thread Tools |
| |||
| Clearing Selection I'm having issues clearing a Selection in either InkOverlay or InkPicture. I'm trying to create an application that lets you select strokes within an InkPicture, perform an action with those selected strokes via a button press, and then clear the selection. Unfortunately, the following command never works: inkPicture.Selection.Clear(); Instead of emptying the selected strokes container, .Clear() does nothing. I've also tried to set the Selection to null, but that only produces a NullReferenceException. Any ideas as to how I can empty the Selection? Thanks, -Aaron |
| |||
| Re: Clearing Selection Hey Aaron, whenever working with a read/write property that takes a Strokes object, you can be pretty sure that modifying it will do nothing. For example, if you tried to do Ink.Strokes.Clear() it would similarly have no effect. The reason being, the Strokes object is more like a recordset. It's a collection of references to strokes. When you access the Selection property, you are getting a copy of that collection and clearing it doesn't actually modify the selection. It's not exactly the most intuitive behavior, but it comes in handy sometimes. But to achieve what you're trying to do, you can set the selection to an empty Strokes collection. Strokes emptyStrokes = inkPicture.Ink.CreateStrokes(); inkPicture.Selection = emptyStrokes; Let me know if this helps. -- Josh Einstein (Tablet PC MVP) Einstein Technologies Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com "Aaron W." <Aaron W.@discussions.microsoft.com> wrote in message news:80E4E41F-42F8-492A-97DD-3A30573BB90B@microsoft.com... > I'm having issues clearing a Selection in either InkOverlay or InkPicture. > I'm trying to create an application that lets you select strokes within an > InkPicture, perform an action with those selected strokes via a button > press, > and then clear the selection. Unfortunately, the following command never > works: > > inkPicture.Selection.Clear(); > > Instead of emptying the selected strokes container, .Clear() does nothing. > I've also tried to set the Selection to null, but that only produces a > NullReferenceException. > > Any ideas as to how I can empty the Selection? > > Thanks, > -Aaron |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The Clouds Are Clearing | TPC | General Questions | 0 | 07-29-2008 02:40 AM |
| Clearing PRN | Jim Hawkins | Windows XP | 3 | 06-25-2008 07:10 AM |
| Clearing search box | gary | Windows XP | 1 | 02-01-2008 09:31 PM |
| Clearing a HD | RBB | Windows XP | 11 | 08-22-2007 08:20 AM |
| Clearing Cache | Lisa | Internet Explorer | 3 | 07-23-2007 06:30 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |