RE: Treeview Rant !
- Posted by Derek Parnell <ddparnell at bigpond.com> Apr 24, 2002
- 362 views
euman at bellsouth.net wrote: > Hello all, > > I found what I consider to be a bug in the Treeview control > > consider this bit of code. -> > > elsif iMsg = TVN_KEYDOWN then > vKey = peek(lParam + 12) --struct tagTVKEYDOWN (WORD wVKey) > if vKey = 9 then > SetFocus(futurecontrol) > elsif vKey = 25 then -- should be shift+tab > SetFocus(previouscontrol) > end if > end if > > works really good but what if someone wanted to reverse the taborder > direction > for focus purposes? > > shift+tab "or" shift = 16 + tab = 9 should be vKey = 25 > but this control doesnt handle this in the right way thus returning vKey > = 9 > > you cant go backward from a Treeview control, unless someone can provide > a > work around... > This one way you might like to try: if StandardTabbing then ForwardTab = 9 BackwardTab = 25 else ForwardTab = 25 BackwardTab = 9 end if . . . elsif iMsg = TVN_KEYDOWN then vKey = peek(lParam + 12) --struct tagTVKEYDOWN (WORD wVKey) if vKey = ForwardTab then SetFocus(futurecontrol) elsif vKey = BackwardTab then -- should be shift+tab SetFocus(previouscontrol) end if end if ------------- This hightlights the problems of too much hard-coding. ----- Derek.