Question

Since I'm just learning C# with .NET, (I have more experience with the XNA framework), I might not use it just the right way.

My problem is from my view very strange. I have made a form with a TabControl inside of it, using the designer. In one of those tab pages I have a ListBox and a ComboBox. The ComboBox has a static number of items which are all declared at intialization for the ComboBox.

Whenever I click the ComboBox to view its list of contents, (which are about 30), and scroll down or up my whole apps's performance sinks a lot for about one second. This makes my ComboBox slow as syrup and on top of all this seems to hit my ListBox since it becomes white for the one second as if it is waiting for redrawal.

Now I have not written any loops or other heavy processing for anything with the ComboBox, everything was written automatically by VisualStudio 2008 and is the standard template code + the items in the box.

EDIT: As I said, the only code is generated by VS 2008 and I have no methods attached to the ComboBox, (Exept for one empty). However the code is here:

// 
// comboBox1
// 
this.comboBox1.DropDownHeight = 200;
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.IntegralHeight = false;
this.comboBox1.Items.AddRange(new object[] {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"});
this.comboBox1.Location = new System.Drawing.Point(26, 362);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(101, 21);
this.comboBox1.TabIndex = 8;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);

Anyone able to share insight in what is happening here?

Was it helpful?

Solution 2

Ok, so I found out what it was, kind of embarassing actually. My app is using a hook but the hook is always up and running, even if not needed. Some restructuring there and the problem should be fixed. Might have to take a look on the hook too since it is not my source from the beginning.

Appreciate the answers though :)

OTHER TIPS

Take a look at this post, it addresses a similar issue.

Slow scrolling in ComboBox

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top