I have noticed a strange effect when I create a Listview.
When I create a ListView without also creating a Button, the selected item in the ListView have a dotted border. However, when I also create a Button, the ListView selected item don't have a dotted border anymore. This only happens when I have a manifest file that enables common controls 6:
This is the code I used to create the Window and ListView and Button:
// Create Window
HWND hWnd = CreateWindowEx(0, "WinClass", "My Window", WS_OVERLAPPEDWINDOW, 261, 172, 394, 284, NULL, NULL, hInstance, NULL);
// Create ListView
HWND hListView = CreateWindowEx(0, WC_LISTVIEW, "", WS_CHILD | LVS_REPORT | WS_VISIBLE, 0, 0, 232, 190, hWnd, 0, GetModuleHandle(NULL), NULL);
// Create Button
HWND hButtonRefresh = CreateWindowEx(NULL, "BUTTON", "OK", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 10, 200, 110, 25, hWnd, NULL, GetModuleHandle(NULL), NULL);
Note: I don't have a problem with this effect, I just want to understand why it is happening!
It's just because the button has the focus and the list view lost it, click on the list view and the dots should reappear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With