I am using Win32 ListView32.
When row in the ListView is selected it has dark blue color.
The row can be selected by either clicking on it or programmatically by calling ListView_SetItemState(hwnd, index, LVIS_SELECTED, LVIS_SELECTED);.
When ListView control focus is lost the selected row becomes gray.
How can I keep selected row with dark blue color irrespective of the focus?
Use the LVS_SHOWSELALWAYS window style. I don't think it can stay as dark blue as that's the indicator that that control has focus.
"Presumably you're doing this in a OnInitDialog handler? If so, you need
to SetFocus to your list control, and return FALSE from OnInitDialog."
If you are using VC6.0. You can set properties as "Show selection always" to ListView. And ListView will be defined by VC6.0 as LVS_SHOWSELALWAYS.
The definition of the CONTROL in resource file looks like:
CONTROL "List2",IDC_LIST_MEMBER,"SysListView32",LVS_REPORT |
LVS_SHOWSELALWAYS | LVS_EDITLABELS | WS_BORDER |
WS_TABSTOP,7,64,514,187
And The selected item will be highlighted. For my program, the default background color is white, the default selected and focused color is blue, and the default selected but lost focused color is gray(when usr click to other control).
Related
Please teach me how to control the background color when right-clicking on TreeView/TreeItem.
Based on https://codesandbox.io/s/jggxz?file=/demo.tsx which is linked from https://material-ui.com/components/tree-view/ ,
in the case of implementing the context menu function, the background color of the right-clicked item is not as expected.
Let me explain how it works by watching the attached video.
Right-click on "Forums" to bring up the context menu.
Then, for a brief moment, "Forums" will get the focus and the background color will change to pink.
After the background color disappears, the context menu will appear.
Also, up to this point, the background color of "Promotions", which was selected from the beginning, is always green.
What I want is the following. What should I do to make it look like the following?
Right-click on "Forums" to bring up the context menu.
Then the background color of the right-clicked item "Forums" will change to green, and
at the same time, the background color of the selected "Promotions" from the beginning will disappear.
Another thing I tried was to use TreeView's "selected" props and useState, but it did not work as expected.
That version is below.
https://codesandbox.io/s/material-demo-forked-h5z8e?file=/demo.tsx
I'm doing sample on Tabs and its working fine but here my question how to show differentiate between selected and non selected Tabs in codenameone. it means after selecting Tab i want to show different background color.
how can i achieve this?
Change the background color of the selected state of Tab Uiid in your Codename One Designer.
I am looking for a SWT Combo where only dropdown arrow is shown in order to save space.
I found that setting a GridData.widthHint to the width of the arrow icon on the Combo might do the trick.
The question is how do I ask the Combo layout the exact width of the down arrow on the Combo so that I can set that as the widthHint?
Update:
Looks like even setting the widthHint = 0 still shows part of the text field. So any other ideas would be welcome.
I don't see a way to get the drop down button width. Messing around with the width hint is likely to be very platform dependent.
An alternative would be to use code similar to the CCombo control but without the Text field. This uses a Button with the SWT.ARROW | SWT.DOWN style:
Button button = new Button(parent, SWT.ARROW | SWT.DOWN);
When the button is pressed an SWT List control is displayed.
I have manually created a pop-up menu.
I have changed the items color to blue.
All the menu items have been changed to blue, except those ones which have been included manually.
How can I change those ones too?
I am currently working in the C# windows application with DevExpress controls.
Now I want to change back color of bar button item while loading the form.
I've tried following code:
barButton.Appearance.BackColor = Color.Red;
but the bar button back color not changed to red.
By default, bars use the skins to draw their content. In this case, all background colors are provided by specific skin elements, which cannot be changed. The only way to change a specific item's background color is to disable skins:
put the BarAndDockingController component onto a form, and assign it to the BarManager.Controller property. Set BarAndDockingController.PaintStyleName or LookAndFeel to any non-skin style(for example "Flat"). Then use the Bar.Appearance.BackColor property to set the desired color.
Alternatively, you can create your own custom barItem in a way similar to the one described in the How to change the background color of highlighted links KB article.