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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:57:16+00:00 2026-06-01T02:57:16+00:00

I am trying to used following code but I am not getting good performance

  • 0

I am trying to used following code but I am not getting good performance in my Application.

I have list of 2000 images in “dt_Images.ToList()”.

In cs:

foreach (var dr in dt_Images.ToList())
            {
                BTN = new Button();
                BTN.Name = dr.Name.ToString();
                BTN.Image = dr.Image;
                BTN.Text = dr.text.ToString();
                flowLayoutPanel1.Controls.Add(BTN);
                BTN.Click += new EventHandler(this.pic_Click);
            }

I have also try to binding with listview but not getting desired speed.

How can I increase speed while binding with flowLayoutPanel?

can i bind direct DataSource in control? then which control i used?

Please help me

  • 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-01T02:57:18+00:00Added an answer on June 1, 2026 at 2:57 am

    I can see that you are using a FlowLayout panel. I suspect it to redo the whole layout each time you add a child control, which might take a lot of time too.

    Can you try to enclose the whole loop this way :

    flowLayoutPanel1.SuspendLayout();
    
    foreach (var dr in dt_Images.ToList())
            {
                BTN = new Button();
                BTN.Name = dr.Name.ToString();
                BTN.Image = dr.Image;
                BTN.Text = dr.text.ToString();
                flowLayoutPanel1.Controls.Add(BTN);
                BTN.Click += new EventHandler(this.pic_Click);
            }
    
    flowLayoutPanel1.ResumeLayout();
    

    You can even try to achieve even better performances by disabling the painting using the answers here.

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

Sidebar

Related Questions

I am trying to create a slide show using NSTimer... But the following code
I normally use scp to copy stuff, but now I'm trying to get used
Just trying to understand that - I have never used it before. How is
I have used several different scripts that people have suggested for trying to parse
I have some strange behavior occurring in an ASP.NET application that I am trying
I'm trying to import an xml file into vb.net XmlDocument but am getting the
I have following type of list <ul id=mylist> <li></li> <li></li> <li class='abc'>first</li> <li></li> <li
I have the following code with private static members. All of these classes say
i'm trying to convert the following code from Java to C#. // Replace 0
I have the following code in both a C# console app and a C#

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.