473,626 Members | 3,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get right click on a ListBox to select item

19 New Member
I have a ListBox with an associated ContextMenu. I want to ensure that, if the user right-clicks on an item, that the item will be selected and the ContextMenu will open properly for it - similarly to the way it works in Explorer.
Dec 24 '13 #1
0 1078

Sign in to post your reply or Sign up for a free account.

Similar topics

3
10265
by: Chris | last post by:
I'm able to add a context menu to the right click on a listbox but it does not select the item in the listbox. I would like the context menu before it pops up to select the item that the mouse was over when the right click occurred. Is this possible? Thanks, Cristov
6
30001
by: Dan Bass | last post by:
If you look at explorer, right clicking on a file, first selects the file, then throws up the context menu relating to that selection. With a Windows ListBox control and a simple context menu, the default behaviour seems to display the context menu on the listbox, but there is no selection. Now I know that explorer's using a listview, and that the context menu acts differently if you click on open space (no selection), but can I...
1
2110
by: Juan Romero | last post by:
Hey guys, I have a small problem here.... I have a treeview control. I want to display a popup menu when the user right clicks on a node. This is no problem, and I am able to make the popup come out. However, when I want to perform an operation based on the node selected, I find that the node actually gets selected after the popup goes away. In other words, if I right click a random item in the treeview and the user selects an...
1
1670
by: BillyB | last post by:
I have a context menu tied to a list box. When I right-click on an item, I'd like that item to be selected before the context menu invokes, similar to how Outlook Express works when right-clicking on mail items. I've figured out how to trap the right-click in the _MouseDown event, but can't figure out how to set the listbox's selected item to the item under the mouse pointer Thanks Billy
1
2457
by: Patrick | last post by:
This may be a simple question but how can I make the tree change the selected node... on a right click .. in addition to the left click? What I want is to filter my context menu based on the type of node selected but the left click doesn't seem to change the selected node. Thanks,
2
1678
by: Niels Jensen | last post by:
Is there a way to select an item ina listbox with the right click event? basically I want a user to be able to rightclick an item which will select the item and then bring up the context menu which has a delete option in it. As it stands if I select an item and then rightclick a seperate item selecting delete will remove the selected item instead of the one that was right clicked Cheers Niels
1
9926
by: johnnypung | last post by:
I have a treeview opening a contextMenuStrip on right click. However the right click would not select the node that it right clicks on. How should I make it so the right click will select the node, and open the contextMenuStrip on that node? I tried this: private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) { treeView1.SelectedNode = treeView1.GetNodeAt(e.X,...
0
1053
by: tarun | last post by:
Hello All, Please find the code for a simple wx.TreeCtrl code. Whenever I right click on any item in the Tree, I see the function, 'OnSelChanged' gets called twice. What I've just done is that I've associated the function 'OnRightClick' with wx.EVT_TREE_ITEM_RIGHT_CLICK. And in this function, I say self.tree.SelectItem(evt.GetItem(),True) to select the item and then so some action for right click.
1
2785
by: gayat jain | last post by:
jsf <h:select item> how i can call bean method one click any select item
6
4814
by: moonrb | last post by:
hi How can i disable right click on report that a user can not change the design of the report. i am using access 2002 Thanks.
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.