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 8812995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:44:04+00:00 2026-06-14T03:44:04+00:00

Basically, I have the following Delphi 2007 code (CustomDrawItem): procedure TForm1.ListViewCustomDrawItem(Sender: TCustomListView; Item: TListItem;

  • 0

Basically, I have the following Delphi 2007 code (CustomDrawItem):

procedure TForm1.ListViewCustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
 if (Item.SubItems[0] = '...') then
  ListView.Canvas.Brush.Color := clSkyBlue;
end;

On my Windows XP, everything works perfectly:

On Windows XP

But on Windows 7, here’s what I have:

On Windows 7

Now, of course, I’d like to know what’s the right code to fill these vertical white stripes. But also, I’d like to know why is this happening. Does it come from Delphi? Windows 7? My code?

  • 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-06-14T03:44:06+00:00Added an answer on June 14, 2026 at 3:44 am

    It seems a Windows 7 paint behavior, as workaround you can set ownerdraw property to true and use the OnDrawItem event instead.

    Like so

    uses
      CommCtrl;
    
    {$R *.dfm}
    
    procedure TForm7.ListView1DrawItem(Sender: TCustomListView; Item: TListItem;
      Rect: TRect; State: TOwnerDrawState);
    var
     LIndex : integer;
     ListView :  TListView;
     LRect: TRect;
     LText: string;
    begin
      ListView:=TListView(Sender);
      for LIndex := 0 to ListView.Columns.Count-1 do
      begin
    
        if not ListView_GetSubItemRect(ListView.Handle, Item.Index, LIndex, LVIR_BOUNDS, @LRect) then
           Continue;
    
        if Item.Selected and (not ListView.IsEditing) then
        begin
          ListView.Canvas.Brush.Color := clHighlight;
          ListView.Canvas.Font.Color  := clHighlightText;
        end
        else
        if (Item.SubItems[0] = '...') then
        begin
          ListView.Canvas.Brush.Color := clSkyBlue;
          ListView.Canvas.Font.Color  := ListView.Font.Color;
        end
        else
        begin
          ListView.Canvas.Brush.Color := ListView.Color;
          ListView.Canvas.Font.Color  := ListView.Font.Color;
        end;
    
        ListView.Canvas.FillRect(LRect);
        if LIndex = 0 then LText := Item.Caption
        else LText := Item.SubItems[LIndex-1];
    
        ListView.Canvas.TextRect(LRect, LRect.Left + 2, LRect.Top, LText);
      end;
    end;
    

    Windows 7

    enter image description here

    Windows XP

    enter image description here

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

Sidebar

Related Questions

Take the following code as a sample: procedure TForm1.Button1Click(Sender: TObject); var Obj: TSomeObject; begin
I'm having an issue with rails involving javascript. Basically, I have the following code:
Basically I have the following code: import multiprocessing import time class MyProcess(multiprocessing.Process): def __init__(self,
I need some help with this. Basically I have the following code which I
So basically I have the following code: Dim myIE As InternetExplorer: Set myIE =
Basically I have the following code working, but i can not find a way
I have the following code: jQuery(#wiggle-available, #wiggle-current ).sortable({ connectWith: .wiggle-connect, items: 'li.sortable', placeholder: ui-state-highlight
I basically have the following string in the format: A,B,C:D,E,F What I am trying
I basically have the following class: .sf-sub-indicator { background: url(/abcprod/images/arrows-ffffff.png) no-repeat -10px -100px; }
I am wondering if the following is possible in MVC 3 I basically have

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.