Windows Develop Bookmark and Share   
 index > Windows Forms General > Runtime Loading/rendering of control takes time ?
 

Runtime Loading/rendering of control takes time ?

Hi friends !
I do have some strange problem.
I am loading some my own control at run time and i do add then in Panel (FlowLayoutPanel).
But when i do run my project i am able to notice rendering of those controls.
I am not able to understand whether it takes time to load control (using new MyClass) or to render them (when I am dointg " panel.Controls.Add(MyControlArray(IndexOfArray))")

MyControls Contains Label,SplitContainer and Object of may be textBox, ComboBox etc.
Some code is listed here !

Sub setProjectScreenControls()
Dim index As Integer = 0
On Error Resume Next
index = 0
'editScreen is my Flow layout panel
If editScreen Is Nothing Or editScreen.IsDisposed Then editScreen = New FlowLayoutPanel


editScreen.Visible = False
editScreen.SuspendLayout()
editScreen.Controls.Clear()

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpPrjName"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpPrjOwner"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpOrganizationID"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripDateTimePicker
editStrips(index).Name = "strpStartDate"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripDateTimePicker
editStrips(index).Name = "strpEndDate"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpDevlopmentURL"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpFinalURL"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripCheckBox
editStrips(index).Name = "strpIsPublished"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpDescription"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpActualEfforts"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpExpectedEfforts"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripTextBox
editStrips(index).Name = "strpMaxFileSize"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpProjectPhaseType"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpProjectType"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpPriority"
index += 1

editStrips(index) = Nothing
editStrips(index) = New myStripComboBox
editStrips(index).Name = "strpStatus"

For i As Integer = 0 To index ' I think this loop may cause the delayed rendering of controls

editScreen.Controls.Add(editStrips(i))
Next
editScreen.ResumeLayout()
End Sub

During exution of this code I can see that controls are being added one by one!
Actually,Ideally all controls should be displayed in at a time !!,

Can any one tell me what wrong here or Any thing wrong with me !!

EmersioN  Friday, November 24, 2006 5:35 AM
Try using SuspendLayout/ResumeLayout on the form too (this.SuspendLayout()).
nobugz  Friday, November 24, 2006 2:41 PM
thanx for Reply but you can see in my code that I have tried it !

EmersioN  Tuesday, November 28, 2006 4:53 AM
Ehrm, no, that's not in the code you posted. You're calling it on editScreen.
nobugz  Tuesday, November 28, 2006 7:52 AM
ok sorry
But actually i am calling SuspendLayout method even for my Form Control and other Tab Control which holds this EditScreen Control (actully it is FlowLayoutPanel)
EmersioN  Tuesday, November 28, 2006 12:13 PM

You can use google to search for other answers

Custom Search

More Threads

• struct designing
• Menu links to utility programs howto?
• Read de body of a drag dropped mail
• Code clean up
• Access Stored Procedure Parameters
• string to float conversion
• Form Designer Error
• Excel-like control
• How To Determine When a Page Is Done Loading in WebBrowser Control - VS05 way
• inputBox