I am upgrading user control from vb6 to vb.net.
In the vb6 application I am loading 3000 labels using a label control array.
In vb.net I am doing same but it's taking too much time to load.
In vb6 it's taking 1-2 seconds, but in vb.net it's taking 30-40 seconds for same work.
What is problem? Why does it take too much time in vb.net for same work?
Code is given below, here Led
is the label control array.
For l = 1 To 3000
Led.Load(ledCounter)
ColLed.Add(Led(ledCounter))
Led(ledCounter).BackColor = System.Drawing.ColorTranslator.FromOle(LedColor)
Led(ledCounter).Top = VB6.TwipsToPixelsY(15)
Led(ledCounter).Left = VB6.TwipsToPixelsX(15)
Led(ledCounter).Height = VB6.TwipsToPixelsY(LedHeight)
Led(ledCounter).Width = VB6.TwipsToPixelsX(LedWidth)
Led(ledCounter).BorderStyle = Windows.Forms.BorderStyle.None
Led(ledCounter).BackColor = System.Drawing.ColorTranslator.FromOle(LedColor)
Led(ledCounter).Visible = True
Next