Print Page | Close Window

Popup menu and treeview control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3643
Printed Date: 06 October 2024 at 2:35am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Popup menu and treeview control
Posted By: KevinC71
Subject: Popup menu and treeview control
Date Posted: 12 February 2006 at 7:44pm

Hi all,

I have a VB UserControl that contains a CommandBars and Shortcut Bar control as well as a TreeView control.  The TreeView control has been embedded into the Shortcut bar client area:

Set oItem = ShortcutBar1.AddItem(m_lTabID, strTabName, TreeView1.hWnd)

In the MouseUp event for the TreeView control I have the following code to create and show a popup menu:

    Dim oPopup As CommandBar
    
    Set oPopup = CommandBars.Add("Popup", xtpBarPopup)
    With oPopup.Controls
        .Add xtpControlButton, 100, "&Open"
        .Add xtpControlButton, 101, "&New"
        .Add xtpControlButton, 102, "&Delete"
    End With
    oPopup.ShowPopup
   

The popup displays and works fine but the problem is when you use the up/down arrow keys.  Focus is changing on the popup menu, which it correct, but focus is also being changed in the TreeView control.  Pressing the up/down arrows keys with an open popup menu should not cause the TreeView to change the current selection.

Any ideas how to prevent this unwanted behavior?

Thanks,

Kevin




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net