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

  • Home
  • SEARCH
  • 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 6032701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:22:21+00:00 2026-05-23T05:22:21+00:00

Background I am working on an application which use listView , and I have

  • 0

Background

I am working on an application which use listView, and I have write some functions for make actions with items in lisyView. I have actions as OnClickCopyAllDomains and OnClickMarkAllDomains. This functions works with domains (listView items) and when listView contain more then 100.000 item I feel how working speed goes down. So below I will show you functions, and I want you to give me advance how I can improve speed of functions?

OnClickMarkAllDomains

This function set listView items checked state to true.

System::Void MainForm::OnClickMarkAllDomains(System::Object^  sender, System::EventArgs^  e) {
        for( int i=0; i<listViewDomainsInfo->Items->Count; ++i )
            listViewDomainsInfo->Items[i]->Checked = true;
    }

OnClickCopyAllDomains

In this function I copy listView items (domains) to the clipboard, I if domains count is more then 100.000 I wait for 5 minutes till action ends.

System::Void MainForm::OnClickCopyAllDomains(System::Object^  sender, System::EventArgs^  e) {
        int itemsCount                  = listViewDomainsInfo->Items->Count;
        System::String^ outputClipboard = System::String::Empty;

        for( int i=0; i<itemsCount; ++i ) {
            outputClipboard += listViewDomainsInfo->Items[i]->Text + "\r\n";
        }

        if( !System::String::IsNullOrEmpty( outputClipboard ) ) {
            try {
                System::Windows::Forms::Clipboard::SetText( outputClipboard );
            }
            catch( ... ) { }
        }
    }

Question

How I can make my functions better, increase their speed ?

  • 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-23T05:22:22+00:00Added an answer on May 23, 2026 at 5:22 am

    Call listViewDomainsInfo->BeginUpdate() before your loops and listViewDomainsInfo->EndUpdate() after.

    Also, string concatenation as you’re using it is extremely inefficient. Make outputClipboard a System::Text::StringBuilder rather than a System::String.

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

Sidebar

Related Questions

First some background: I'm working on an application and I'm trying to follow MVVM
Background Currently, I am working on a Rails application. I have different products that
Background I'm working on an application which requires user-entered content, and I've decided to
Background I'm working on a an educational JavaScript application/site (SPA) that will eventually have
Background I am working on a phonetic converter program which converts english text into
Long-Winded Background I'm working on parallelising some code for cardiac electrophysiology simulations. Since users
hiii frends, actually i am working on an application which requires images such as
I'm working on a background service which needs to ask several users' iTunes settings
I am trying to create an application which allows background threads to update core
I am working with a team on LoB application. We would like to 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.