Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7638815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:15:56+00:00 2026-05-31T08:15:56+00:00

Possible Duplicate: How can I remove the selection border on a ListViewItem I’m using

  • 0

Possible Duplicate:
How can I remove the selection border on a ListViewItem

I’m using the following code to make a Listview to use windows 7 native look and to prevent flickering.

Windows 7 Native Look for .NET ListView

http://geekswithblogs.net/CPound/archive/2006/02/27/70834.aspx

But I’m still getting a black dotted selection rectangle.

dotted

explorer

The question will be… How can I achieve the explorer selection rectangle?

Thank you so much for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:15:57+00:00Added an answer on May 31, 2026 at 8:15 am

    Based on the comment in the link provided by AVIDeveloper.

    While the ShowFocusCues itself didn’t work, the WM_CHANGEUISTATE
    listed on that MSDN page led me to the right answer. By sending a
    WM_CHANGEUISTATE message with UISF_HIDEFOCUS I was able to get rid of
    the focus rectangle. – Telanor Apr 22 ’10 at 17:11

    I tried to find some information about this messages and eventualy saw this post: http://cboard.cprogramming.com/csharp-programming/128345-listview-remove-focuscues.html#post958690

    So, we need to send the WM_CHANGEUISTATE message to the ListView in the constructor

    SendMessage(Handle, 0x127, 0x10001, 0);
    

    And we are only going to override the OnSelectedIndexChanged and OnEnter events.

    protected override void OnSelectedIndexChanged(EventArgs e)
    {
        base.OnSelectedIndexChanged(e);
        SendMessage(Handle, 0x127, 0x10001, 0);
    }
    protected override void OnEnter(EventArgs e)
    {
        base.OnEnter(e);
        SendMessage(Handle, 0x127, 0x10001, 0);
    }
    

    Without overriding the OnEnter event, the same black dotted selection rectangle will appear when the ListView gets the focus.

    I tried to explain the best I could since I’m not a fluent English speaker and I’m going to wait if someone has a better answer before accepting mine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Remove CSS from a Div using JQuery we can set backgroung-image property
Possible Duplicate: How to delete a zip file using php How can I remove
Possible Duplicate: How can I remove external links from HTML using Perl? Alright, i'm
Possible Duplicate: Can't remove Default.png? I am using Xcode 4, but I am sure
Possible Duplicate: How can I use a carriage return in a HTML tooltip? I'd
Possible Duplicate: Remove the date/time in my sql script generated using EM? Database -
Possible Duplicate: Removing multiple classes (jQuery) how can we remove multiple classes from one
Possible Duplicate: PHP: How to remove specific element from an array? How can i
Possible Duplicate: Can you compile C# without using the .Net framework? im sure it's
Possible Duplicate: How to remove rvm (ruby version manager) from my system? How can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.