I created form which uses double buffering for everything.
If form is resized, listbox content is flashing.
In MONO ListBox is resized smoothly.
How to fix code so that it does not flash in .NET also ?
Andrus.
using System.Windows.Forms;
public class Test
{
static void Main()
{
Application.Run(new ReportDialogForm());
}
}
class ReportDialogForm : Form
{
public ReportDialogForm()
{
DoubleBuffered = true;
tabControl1 = new BufferedTabControl();
tabPage1 = new BufferedTabPage();
reportListBox = new BufferedListBox();
tabControl1.Dock = DockStyle.Fill;
tabControl1.Controls.Add(tabPage1);
tabPage1.Controls.Add(reportListBox);
reportListBox.Dock = DockStyle.Fill;
Controls.Add(tabControl1);
for (int i = 0; i < 100; i++)
reportListBox.Items.Add("MMMMMMMMMMMMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMMMMMMM");
}
class BufferedListBox : ListBox
{
internal BufferedListBox()
{
DoubleBuffered = true;
}
}
class BufferedTabControl : TabControl
{
internal BufferedTabControl()
{
DoubleBuffered = true;
}
}
class BufferedTabPage : TabPage
{
internal BufferedTabPage()
{
DoubleBuffered = true;
}
}
BufferedTabControl tabControl1;
BufferedTabPage tabPage1;
BufferedListBox reportListBox;
}