Technology Questions

Go Back   Technology Questions > Hardware Questions > Mobile Computers > Tablet PC > Tablet PC Software > Tablet PC Developers

Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-06-2007, 07:31 AM
Aaron W.
Newsgroup Contributor
 
Posts: n/a
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 05-06-2007, 07:31 AM
  #2 (permalink)  
Old 05-06-2007, 07:31 AM
Josh Einstein
Newsgroup Contributor
 
Posts: n/a
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
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?

All times are GMT -8. The time now is 12:39 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0