C
C#3mo ago
a_oso

[WinForms] Need help optimizing custom controls creation/updating of ui

I have custom controls that is being dynamically created based on data from several API calls. These controls are being created after the processing of data is finished. There were no issues from API calls/mapping of data since I can see that the custom controls are being created immediately after opening the form but the problem is updating the data on the UI. It takes several seconds for the UI to get updated and it gets slower the more controls there is. I have used SuspendLayout/ResumeLayout/PerformLayout before for updating a certain Custom Control, but I want to increase the speed on how the UI gets updated. This is the flow: 1. Click button to open the form 2. Parent Form gets created and creates some other UI control 3. Parent Form displays and proceeds to create the custom controls (at this point, the "base" custom controls are already created, however the data still needs to get updated. The data are the scribbles in the drawing, it's just a bunch of text) 4. Each custom control will be updated based on the data. Each custom control's size are dynamic and will depend on how long the texts are. (This is what I want to optimize, it takes several seconds to get updated and it increases depending on the number of controls/height of controls)
No description
1 Reply
HtmlCompiler
HtmlCompiler3mo ago
what have you tried? can you count how many messages are being processed from the process (as an emergency case)? have you tried with mocked data? have you found a correlation between number of controls and responsiveness (like linear or super-linear)?
Want results from more Discord servers?
Add your server