Profile Picture

How do I focus a Canvas programmatically?

Posted By Karl Hulme 9 Years Ago
Author
Message
Karl Hulme
Question Posted 9 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 6, Visits: 16
Whenever I call NCanvas.Focus() it always returns false.

I've set NCanvas.AllowFocus to true, along with .AllowMouseCapture and .AllowDrop and .AllowTabStop.
I've also provided a FocusDecorator by specifying a color and stroke width. (This works occasionally but I'm not sure what's triggering when this does or doesn't appear)

I'm using the NCanvas.GotFocus and LostFocus events to determine if focus has been achieved.  My real interest is using the KeyDown event.

I find that I can tab into the canvas from the NTab parent, and then all the events fire as required.
But I cannot focus the canvas simply by clicking on it, or by calling NCanvas.Focus().

What am I missing?




Similar Topics


Reading This Topic