Click here to Skip to main content
15,887,344 members
Home / Discussions / C#
   

C#

 
GeneralRe: Data Access Layer for C# Pin
levanduyet_vn29-Feb-16 22:48
levanduyet_vn29-Feb-16 22:48 
AnswerRe: Data Access Layer for C# Pin
V.1-Mar-16 1:02
professionalV.1-Mar-16 1:02 
GeneralRe: Data Access Layer for C# Pin
levanduyet_vn1-Mar-16 1:16
levanduyet_vn1-Mar-16 1:16 
AnswerRe: Data Access Layer for C# Pin
Frank Kerrigan4-Mar-16 3:54
Frank Kerrigan4-Mar-16 3:54 
QuestionAmend connection string from app.config and save back Pin
levanduyet_vn29-Feb-16 19:07
levanduyet_vn29-Feb-16 19:07 
AnswerRe: Amend connection string from app.config and save back Pin
Bernhard Hiller29-Feb-16 21:19
Bernhard Hiller29-Feb-16 21:19 
GeneralRe: Amend connection string from app.config and save back Pin
levanduyet_vn29-Feb-16 21:43
levanduyet_vn29-Feb-16 21:43 
QuestionShow panel after a job is completed Pin
Pablo Bozzolo29-Feb-16 6:13
Pablo Bozzolo29-Feb-16 6:13 
Hi!

I've a bi-dimensional array of labels (a lot of them) so when I make change properties the render is to slow.

My solution (I thought) was make the panel invisible at the init time and then visible when the job is completed but it's visible before the job is completed! I think my app is multithreaded for default.

C#
using System;
using System.Windows.Forms;

namespace Program
{

    public partial class Form1 : Form
    {     
        MySqlConnection cn = new MySqlConnection();
        iTextSharp.text.pdf.PdfWriter writer;

        const int panelHeight = 730;
        const int panelWith = 1070;
        private Label[,] lbs = new Label[70,50];
              

        public Form1()
        {
            InitializeComponent();
            initBoard();            
        }
       
        private void initBoard()
        {
            panel1.Size = new Size(panelWith, panelHeight);
            panel1.Visible = false;
            anel1.BackColor = SystemColors.ControlText;
        

            int cc, ff;
            for (int c = 0; c < 70; c++)
            {
                cc = c * 15;
                for (int f = 0; f < 50; f++)
                {
                    ff = f * 20;
                    Label lb = new Label();                    
                    lbs[c, f] = lb;                   
                    lb.Size = new Size(15, 20);
                    lb.Font = new System.Drawing.Font(label1.Font.Name, 12, FontStyle.Bold);                    
                    lb.Location = new System.Drawing.Point(cc + 10, ff + 10);
                    lb.Parent = panel1;
                    lb.ForeColor = Color.WhiteSmoke;
                }
            }

        }

        private void button1_Click(object sender, EventArgs e)
        {            
                        
            for (int c = 0; c < 70; c++)
                for (int f = 0; f < 50; f++)
                    lbs[c, f].Text =  (f % 10).ToString();

            panel1.Visible = true;

        }


    }
}


Any ideas ?

Of course I'm just starting.... this is not the way I should program

modified 29-Feb-16 12:27pm.

GeneralRe: Show panel after a job is completed Pin
Richard MacCutchan29-Feb-16 7:02
mveRichard MacCutchan29-Feb-16 7:02 
GeneralRe: Show panel after a job is completed Pin
Pablo Bozzolo29-Feb-16 7:32
Pablo Bozzolo29-Feb-16 7:32 
SuggestionRe: Show panel after a job is completed Pin
Sascha Lefèvre29-Feb-16 7:48
professionalSascha Lefèvre29-Feb-16 7:48 
GeneralRe: Show panel after a job is completed Pin
Pablo Bozzolo29-Feb-16 8:07
Pablo Bozzolo29-Feb-16 8:07 
GeneralRe: Show panel after a job is completed Pin
Sascha Lefèvre29-Feb-16 8:21
professionalSascha Lefèvre29-Feb-16 8:21 
GeneralRe: Show panel after a job is completed Pin
Pablo Bozzolo29-Feb-16 9:16
Pablo Bozzolo29-Feb-16 9:16 
GeneralRe: Show panel after a job is completed Pin
Mycroft Holmes29-Feb-16 11:56
professionalMycroft Holmes29-Feb-16 11:56 
GeneralRe: Show panel after a job is completed Pin
Richard MacCutchan29-Feb-16 10:42
mveRichard MacCutchan29-Feb-16 10:42 
AnswerRe: Show panel after a job is completed Pin
Luc Pattyn29-Feb-16 17:30
sitebuilderLuc Pattyn29-Feb-16 17:30 
AnswerRe: Show panel after a job is completed Pin
BillWoodruff1-Mar-16 1:00
professionalBillWoodruff1-Mar-16 1:00 
QuestionConditional Mathematical Statements Pin
Member 1226553728-Feb-16 21:39
Member 1226553728-Feb-16 21:39 
AnswerRe: Conditional Mathematical Statements Pin
Pete O'Hanlon28-Feb-16 22:08
mvePete O'Hanlon28-Feb-16 22:08 
AnswerRe: Conditional Mathematical Statements Pin
Sascha Lefèvre28-Feb-16 22:09
professionalSascha Lefèvre28-Feb-16 22:09 
Questionicon/image in datagridview Pin
Any_name_at_all28-Feb-16 1:52
Any_name_at_all28-Feb-16 1:52 
AnswerRe: icon/image in datagridview Pin
Dave Kreskowiak28-Feb-16 4:25
mveDave Kreskowiak28-Feb-16 4:25 
GeneralRe: icon/image in datagridview Pin
Any_name_at_all28-Feb-16 5:52
Any_name_at_all28-Feb-16 5:52 
QuestionHow does Observable.Join work? Pin
Kenneth Haugland27-Feb-16 18:38
mvaKenneth Haugland27-Feb-16 18:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.