[Mono-bugs] [Bug 661893] New: TabControl draws previously focused ComboBox on wrong TabPage

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Dec 30 13:26:00 EST 2010



           Summary: TabControl draws previously focused ComboBox on wrong
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: c8 at vokabeln.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

Created an attachment (id=406612)
 --> (http://bugzilla.novell.com/attachment.cgi?id=406612)
full VB.NET Project (use bin\Release\Test002TabControl.exe to test on Mac)

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; MDDC; .NET4.0C)

On a Windows Form, I created a TabControl with two TabPages. On TabPage1, I put
a ComboBox with .DrowDownStyle = DropDownList and a few Items ("a", "b", "c").
TabPage2 remains empty. 

Now I started the programme on Mac, and perform the following mouse clicks: 
- Select any Item from the ComboBox on TabPage1
- Now immediately click on TabPage2
The ControlBox is now visible on TabPage2 (but cannot be used there). 

Reproducible: Always

Steps to Reproduce:
1. In VB.NET, created a Form with the following designer code: 

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
  Inherits System.Windows.Forms.Form

  <System.Diagnostics.DebuggerNonUserCode()> _
  Protected Overrides Sub Dispose(ByVal disposing As Boolean)
      If disposing AndAlso components IsNot Nothing Then
      End If
    End Try
  End Sub

  Private components As System.ComponentModel.IContainer

  <System.Diagnostics.DebuggerStepThrough()> _
  Private Sub InitializeComponent()
    Me.TabControl1 = New System.Windows.Forms.TabControl
    Me.TabPage1 = New System.Windows.Forms.TabPage
    Me.ComboBox1 = New System.Windows.Forms.ComboBox
    Me.TabPage2 = New System.Windows.Forms.TabPage
    Me.TabControl1.Location = New System.Drawing.Point(23, 21)
    Me.TabControl1.Name = "TabControl1"
    Me.TabControl1.SelectedIndex = 0
    Me.TabControl1.Size = New System.Drawing.Size(243, 222)
    Me.TabControl1.TabIndex = 0
    Me.TabPage1.Location = New System.Drawing.Point(4, 22)
    Me.TabPage1.Name = "TabPage1"
    Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
    Me.TabPage1.Size = New System.Drawing.Size(235, 196)
    Me.TabPage1.TabIndex = 0
    Me.TabPage1.Text = "TabPage1"
    Me.TabPage1.UseVisualStyleBackColor = True
    Me.ComboBox1.DropDownStyle =
    Me.ComboBox1.FormattingEnabled = True
    Me.ComboBox1.Items.AddRange(New Object() {"a", "b", "c"})
    Me.ComboBox1.Location = New System.Drawing.Point(17, 33)
    Me.ComboBox1.Name = "ComboBox1"
    Me.ComboBox1.Size = New System.Drawing.Size(195, 21)
    Me.ComboBox1.TabIndex = 0
    Me.TabPage2.Location = New System.Drawing.Point(4, 22)
    Me.TabPage2.Name = "TabPage2"
    Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
    Me.TabPage2.Size = New System.Drawing.Size(235, 196)
    Me.TabPage2.TabIndex = 1
    Me.TabPage2.Text = "TabPage2"
    Me.TabPage2.UseVisualStyleBackColor = True
    Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
    Me.ClientSize = New System.Drawing.Size(284, 262)
    Me.Name = "Form1"
    Me.Text = "Form1"

  End Sub
  Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
  Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
  Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
  Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
End Class

2. Compile the program and run it on Mac OS X using Mono. 

3. Use the mouse to select an Item from the ComboBox on TabPage1, then
immediately click on TabPage2
Actual Results:  
The ComboBox from TabPage1 is visible on TabPage2. 

Expected Results:  
TabPage2 should, of course, be empty.

I made the following additional observations: 

* This problem happens on Mac, but not on Windows (sorry, I could not test it
on Linux). 

* It does NOT happen if I click on TabPage1 -> ComboBox -> TabPage1 ->
TabPage2. So, TabPage2 must be clicked immediately after selecting an Item from
ComboBox, for the problem to arise. 

* Similar effects can be observed if, instead of a ComboBox, you focus a
CheckBox on TabPage1, or if you *select* text in TextBox on TabPage1 (but not
if you put the cursor in the TextBox without selecting text)

* I checked the order of events fired, and that was fine (i.e. Windows and Mac
showed the same order (but Mac had three events more than Windows): 

- TabPage1.Leave [only on Mac]
- TabPage1.Validating
- TabPage1.Validated
- TabControl.Deselecting
- TabControl.Deselected
- TabPage1.Leave
- TabControl.Selecting
- TabPage2.Enter
- TabControl.SelectedIndexChanged
- TabControl.MouseDown
- TabControl.LostFocus [only on Mac]
- TabControl.LostFocus [only on Mac]
- TabControl.Click 
- TabControl.MouseClick
- TabControl.MouseUp.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list