I have created a dynamic GUI library based on Windows Forms (C#) and I am using it in complex Forms with many Controls being modified at the same time.
I have had performance issues during size and position changes and that's why I measured the time needed for each change. These are examples of my measurements (where I actually have a problem):
- TextBox Width set (2,0001 msecs, 3929 ticks)
- TextBox Left set (1 msecs, 2417 ticks)
- ComboBox Width set (3,0001 msecs, 6906 ticks)
- ComboBox Left set (1 msecs, 1318 ticks)
First of all: I know it is not much for a TextBox or ComboBox to take 2-3 msecs to change it's Width, but it would help me greatly if I could bring this time down to as less as it gets. I have 100-300 Controls in each form, so I get a lag of 400 msec - 1200 msec each time I resize the whole thing, which creates a bad result.
Secondly: The resizing of my forms would be smoother, if I had a way to avoid flickering, while the Widths and Lefts are being changed. If I use Hide and Show in the whole form, I have the form disappearing for a moment and showing up again. If I don't, the Controls flicker. Is there a way to avoid flickering?
EDIT: Espesially for comboboxes I get realy slow times, also depending on the number of items they have. But why should the number of items delay a width set. I am sharing some additional results for combobox times:
- ComboBox Width set (1 msecs, 3056 ticks)
- ComboBox Width set (1,0001 msecs, 2548 ticks)
- ComboBox Width set (0 msecs, 1241 ticks)
- ComboBox Width set (1,0001 msecs, 1646 ticks)
- ComboBox Width set (1 msecs, 1052 ticks)
- ComboBox Width set (1,0001 msecs, 3626 ticks)