M
Marko Bozikovic
Hi all,
(I'm reposting this, original title was misleading)
I'm new to .NET, and I have a silly little problem. My application's layout is
simple: a window with one splitter with a treeview control in the left pane
and a Panel for rendering a DirectX scene in the right pane.
My problem is the KeyDown event. Before adding splitter and treeview,
everything worked fine - rendering panel received key events (I'm interested
in up/down/left/right/pageup/pagedown)
However, after I have added splitter and the treeview, my rendering panel
doesn't receive KeyDown events for up/down/left/right (they seem to be routed
to TreeView controls (render panel still receives pageup/pagedown events)
I'm aware of the focus problems with Panels, and I set main form's
ActiveControl to my render panel in panel's MouseDown event handler (actually,
this seems to set *splitter's* ActiveControl property, but it seems to be
working). The treeview control loses focus (as expected) and my render panel
handles pageup/pagedown keys. But, if I press one of up/down/left/right keys,
the treeview steals focus and responds to the key event.
I have even added a handler for PreviewKeyDown event in the rendering panel,
and it gets called for all keypresses, but I still don't know how to prevent
treeview from stealing focus.
Any ideas? (I'm using .NET 2.0)
Thank you,
--
Marko
ICQ: 5990814
I'm not under the alkafluence of inkahol
that some thinkle peep I am.
It's just the drunker I sit here the longer I get.
(I'm reposting this, original title was misleading)
I'm new to .NET, and I have a silly little problem. My application's layout is
simple: a window with one splitter with a treeview control in the left pane
and a Panel for rendering a DirectX scene in the right pane.
My problem is the KeyDown event. Before adding splitter and treeview,
everything worked fine - rendering panel received key events (I'm interested
in up/down/left/right/pageup/pagedown)
However, after I have added splitter and the treeview, my rendering panel
doesn't receive KeyDown events for up/down/left/right (they seem to be routed
to TreeView controls (render panel still receives pageup/pagedown events)
I'm aware of the focus problems with Panels, and I set main form's
ActiveControl to my render panel in panel's MouseDown event handler (actually,
this seems to set *splitter's* ActiveControl property, but it seems to be
working). The treeview control loses focus (as expected) and my render panel
handles pageup/pagedown keys. But, if I press one of up/down/left/right keys,
the treeview steals focus and responds to the key event.
I have even added a handler for PreviewKeyDown event in the rendering panel,
and it gets called for all keypresses, but I still don't know how to prevent
treeview from stealing focus.
Any ideas? (I'm using .NET 2.0)
Thank you,
--
Marko
ICQ: 5990814
I'm not under the alkafluence of inkahol
that some thinkle peep I am.
It's just the drunker I sit here the longer I get.