Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Popup menu and treeview control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Popup menu and treeview control

 Post Reply Post Reply
Author
Message
KevinC71 View Drop Down
Newbie
Newbie
Avatar

Joined: 12 February 2006
Location: United States
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote KevinC71 Quote  Post ReplyReply Direct Link To This Post Topic: Popup menu and treeview control
    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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.