list box items context menu WPF - wpf-controls

I have list box that contains UserControl as item template
the user control contains few text blocks in a grid,
the thing is that I want to add context menu to my user control that will show on the list item right click but currently only right clicking the textbox inside the user control triggers the context menu appearance
clicking the spaces between those textboxes triggers nothing,
any idea about how can I trigger the context menu from the container list box?
Thanks
Eran

From the sounds of it you have set the context menu at the textbox level of the usercontrol.
If you want the context menu to function for the entire user control you would need to set teh contextmenu of the user control at the item template level.

Related

How to add a radio button to an already existing Group Box in Excel

I am working on an Excel sheet that was made by someone else. There are some radio buttons in a group box linked to a macro. I have made the changes into the macro and want to add another radio button in the group box. How can I do that? When I add the new button, it is working separately from the other buttons in the group.
Thanks!
Since you do not answer the clarification questions, please proceed in the next way, according to the radio button type:
Form type radio buttons:
a. You firstly need to insert a Group Box (Developer Tab - Design Mode - Group Box
b. Drag the Form radio buttons on it.
All radio buttons placed on such a group box will act in the same group
ActiveX radio buttons:
a. You simply drag them on the sheet.
b. Press Properties from Developer tab Controls group and set the same group name (string) in GroupName property.
The radio buttons having the same GroupName will act as a group.
Since you do not say anything about the group boxes, most probably you are using ActiveX radio buttons. So, check the GroupName property of existing one in the group you need to add a new one and use the same.

Keyboard accessibility ( WCAG) in panels with list of elements that has assigned button role

Hi :) I would like to ask you about how to treat elements that compose a list, but whom have assiged a button role and are put in side panel ( so it is not a menu or dropdown). My main problem is how to decide is to where ARROWS should works and where TAB.
Moreover I have a differ types of list items that consist of:
checkbox/ radiobutton only
checkbox/ radiobutton with a link to another panel
two icons/ buttons that has defined an activities etc.
Please look at pictures and help me please :)
PINK - "arrows"
BLUE - "TAB"key
You should hardly decide which component will use TAB key or Arrow Keys. Keyboard accessibility for a large number of components is already defined in WAI-ARIA Authoring Practices.
Adding a different behavior could create issues to both sighted, and non-sighted users because they'll already be knowing which key to use based on the component or they'll know intuitively because of standard roles or they'll know as they use keyboard more to browse.
Offer List
Listbox will work. Arrow Keys to navigate and Enter key to perform the action.
List of Checkboxes and Radio Buttons
I would recommend to keep Checkboxes and Radio Buttons to their default keyboard behavior. Since your cases are more of a list, you can convert the list of checkboxes and radio buttons to Single Select and Multi Select Listboxes and use Checkbox and Radio Button as a font icon or graphic to show the selection, similar to how tick is shown in this Listbox example. When you convert to a Listbox, you'll meet the Arrow Keys requirement.
Selected Fruits List
There are some issues in the required keyboard behavior: How will user know if Arrow-Left or Arrow-Right need to be presed, think about non-sighted users.
Fruit Name and i icon button
In your need, you want both Fruit Name and i icon button to open a panel, suggest to NOT use Arrow-Right to i icon button and only use the Enter key to open the panel. May be you don't need i icon button at all.
Delete icon button
Suggest to use DEL key to delete the item
Conclusion
Remove i icon button. If you can't just keep it as graphic element without any events
Use Enter key to open the panel
Use DEL key to delete the item
I think the whole list will then become a listbox, navigable using Arrow Keys and Enter to invoke an operation
Vegetables List
Neither Accordion nor Nested List works here because you have two actions to do: Make a selection, and Expand and Collapse. I haven't tried TreeView but you can check.

How to make subtree items respond to click event in MFC

I have a tree control in an MFC application. I have a function which displays a message box when the tree control is clicked. But I want the individual tree items and sub items to be clickable. I am new to MFC so any help will be appreciated
You get a notification with NM_DBLCLK
The first click of the double click will select the item. You can retrieve the item that is currently selected and double clicked with TVM_GETNEXTITEM TVGN_CARET. The MFC function is CTreeCtrl::GetSelectedItem

Menus with multiple item-columns javaFX 8

My goals is to create a menu with multiple columns. I went about this by using GridPane, to which I added Labels. Then I inserted the GridPane in a PopOver. I also added action listeners to Labels So when the users click on a cell, I can do a certain action. My current implementation is based on a button. Once clicked, the PopOver will show up.
As an example, font names:
Is there a way to have this in a menu?
I tried making the MyGridPane class that extends MenuItem. It allows me to add the GridPane to the menu, but it only comes in as an ObjectID. If I want it visually, the only way I found was to
menuItem.setGraphic()
But this make the whole GridPane one item. The cells and their action listeners get ignored.
Is there a way to add a grid pane as a menu item?
Is there a way to add a grid pane as a menu item?
Yes, you can try as
CustomMenuItem menuItem = new CustomMenuItem(gridPane);
menuItem.setHideOnClick(false);
To visually disable the highlight color for that menu/menuitem, customize the related CSS selectors of menu/menuitem.

How to modify EditField value on CheckBox action in InstallShield

I have EditField (it has global property EDITPROP) on the same window I have checkBox. I want to midify text that is visible in EditField when I check CheckBox.
I create action that modifies this property (EDITPROP) and run it on CheckBox click (as and DoAction). But when I click on CheckBox, I cannot see any changes in text on EditField.
What should I do in order to show this updated text on the EditField ?
It's an MSI limitation that while EDITPROP will have the selected value as defined in the CheckBox table, and UI elements using it ( [EDITPRO] ) won't refresh until you call NewDialog to go to the next dialog. A work around for this behavior is to use ControlConditions to show/hide two mutually exclusive Text controls that use static text to represent the selected and unselected state.

Resources