While developing a module for our Coop System application, I found a quirk bug on Visual Studio 2008 Designer.

bugonvs2008.jpg

The bug is about an enabled timer in a User Control in a Form. When switching to View Code, you can no longer edit your code since the cursor is focused somewhere else.

Steps to reproduce.

  1. Create a C# Windows Forms Application.
  2. Create a User Control into your project.
  3. Add a timer into your User Control.
  4. Add a TextBox item to the User Control.
  5. Select the timer and set the Enable to True in the Properties.
  6. Double -click the Timer to add a Tick event.
  7. In the Tick event, write the following code: textBox1.Focus();
  8. Build the solution.
  9. After successfully building the solution, you can now see the User Control from the Toolbox.
  10. Drag the User Control to the Form1 (main form)
  11. Build the solution.
  12. On the main form, switch to View Code.
  13. Holla!!! Now, see the effect.

Download the sample solution here BugOnDesignerWithTimer.zip