Re: GUI Control - is it possible to catch keypresses??

"valery_vi" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
Why not?

#include <GuiTreeView.au3>
Global $hWnd, $Tree
$hWnd = GUICreate("Tree", 392, 254)
HotKeySet("{Del}", "DeleteTreeItem")

;Tree items
$Tree = GUICtrlCreateTreeView(10, 10, 150, 150)
$Item1 = GUICtrlCreateTreeViewItem("Item1", $Tree)
$Item2 = GUICtrlCreateTreeViewItem("Item2", $Tree)
$Item21 = GUICtrlCreateTreeViewItem("Item21", $Item2)
$Item211 = GUICtrlCreateTreeViewItem("Item211", $Item21)
$Item212 = GUICtrlCreateTreeViewItem("Item212", $Item21)
$Item2121 = GUICtrlCreateTreeViewItem("Item2121", $Item212)

;Show it
GUISetState()

While 1
	$Msg = GUIGetMsg()
	if $Msg = $GUI_EVENT_CLOSE then ExitLoop
WEnd

Exit

;Delete selected tree item
func DeleteTreeItem()
 _GUICtrlTreeViewDeleteItem ($hWnd, $Tree)
return
endfunc

Valery

--- In [email protected], Robert Walker 
<robert_mt_walker@...> wrote:
>
> Hi
> 
> I it possible to catch key presses (like the 'delete') key on 
something like a  TreeView control element? I see the keyboard 
doesn't generate an event (only selection with a left mouse button 
seems to do this). Would like to be able to delete subtrees using a 
keypress!!
> 
> Thx for any help that you guys can give!!
> 
> -- 
> Best regards,
>  Robert                          mailto:robert_mt_walker@...
> 
> 
> 		
> ___________________________________________________________ 
> All New Yahoo! Mail – Tired of Vi@gr@! come-ons? Let our SpamGuard 
protect you. http://uk.docs.yahoo.com/nowyoucan.html
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.