Sign in to follow this  
Followers 0
Hawkysoft

[Q] Listview columns selection highlight

8 posts in this topic

Hey all,

Since I'm playing with listviews atm I stumbled at the ugly part when you click a column it get's highlighted, is there anyway that when I click on a column it doesn't get highlighted?

with regards,

Hawkysoft

Share this post


Link to post
Share on other sites



no one has an idea?

Share this post


Link to post
Share on other sites

Zedna, I see that you like this solution. I like it myself.

Hawkysoft, If you mean the light gray background typically used for sorted listviews to indicate the column which is used for the current sorting, then there is an easy solution.

Take a look at the examples for GUICtrlRegisterListViewSort in the help file. These example creates this gray background. Find the while loop. To get rid of the gray background just comment away the two lines as shown in the code box:

Case $lv
  $bSet = 0
  $nCurCol = $nCol
  ;GUICtrlSendMsg($lv, $LVM_SETSELECTEDCOLUMN, GUICtrlGetState($lv), 0)
  ;DllCall("user32.dll", "int", "InvalidateRect", "hwnd", ControlGetHandle($hGUI, "", $lv), "int", 0, "int", 1)

Share this post


Link to post
Share on other sites

Zedna, I see that you like this solution. I like it myself.

 

Yes. I like it VERY MUCH!

I have implemented it into one of my projects so I'm very happy now :-)

Thanks for nice and elegant solution :thumbsup:

Share this post


Link to post
Share on other sites

I have been familiar with ListView CUSTOMDRAW already (use it in my projects)

so it was only few lines of your code, which were new to me ;-)

As I said, very elegant solution.

I like to learn new elegant code snipets, especially in GUI parts

and such very good lesson from your nice code was the best one in several previous years for me :-)

Share this post


Link to post
Share on other sites

Thank you Zedna for pointing me out, and Lars you for creating that super example! sorry for the late reaction btw, been busy irl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0