I am implementing a QWERTY-style keyboard on a cheap touchscreen PC running (similar to a bank ATM). The Panel container has several dozen buttons and when the user presses "Shift", I swap all the text on the buttons. For example, btnPos12.Text = (m_bShiftOn) ? "Q" : "q"; in a big loop for all buttons on the Panel.
This works fine, but because the processor is not very powerful, there is significant flicker as all the button text changes. I'd like to suspend all text updates till they've all been done and then...bang!...change them all (aka double-buffering). I tried using this thread: How do I suspend painting for a control and its children?
This works very well for single controls, such as a multi-line TextBox, but does not prevent each button's text from updating.
I then tried changing the text on a single button. First I suspended drawing on that button, and then changed the text in a big loop...but again the text changes each time btnPosXX.Text = ... is called. Is there any way to prevent changes to the "Text" property of a control?
int nShiftIndex = (m_bShiftOn) ? UPPER : LOWER;
for (int nButton = 0; nButton < pnlButtons.Controls.Count; nButton++)
{
pnlButtons.Controls[nButton].Text = m_aszKeys[nShiftIndex];
}