https://bugzilla.novell.com/show_bug.cgi?id=389253


           Summary: ListBox: exception occurs on setting small height (one
                    item high etc)
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]
          Found By: ---


Repro app from bug 389250.  Set ListBox to 200 wide (to avoid bug 389250), and
height 40 (to round down to two item 'integral' height of 30 or 32).  The first
exception below will occur.

If one sets the height to zero high(!), then on any action the second exception
occurs (Shift+Tab backwards from the height field to the ListBox then
Down-Arrow to move items.

[[

Unhandled Exception: System.DivideByZeroException: Division by zero
  at System.Windows.Forms.ListBox.GetItemRectangle (Int32 index) [0x00036] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:807
 
  at System.Windows.Forms.ListBox.GetItemDisplayRectangle (Int32 index, Int32
first_displayble) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1274
 
  at System.Windows.Forms.ListBox.LastVisibleItem () [0x00043] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1350
 
  at System.Windows.Forms.ListBox.LayoutListBox () [0x00039] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1173
 
  at System.Windows.Forms.ListBox.OnResize (System.EventArgs e) [0x00022] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:976
 
  at System.Windows.Forms.Control.OnSizeChanged (System.EventArgs e) [0x00006]
in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:6495
 
  at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32 width,
Int32 height, Int32 clientWidth, Int32 clientHeight) [0x000ec] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5138
 
  at System.Windows.Forms.Control.UpdateBounds () [0x0002c] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5087
 
  at System.Windows.Forms.Control.WmWindowPosChanged
(System.Windows.Forms.Message& m) [0x00012] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5441
 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00164] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5249
 
  at System.Windows.Forms.ListBox.WndProc (System.Windows.Forms.Message& m)
[0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1135
 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:227
 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:208
 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00084] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:240
 
  at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message,
IntPtr wParam, IntPtr lParam) [0x0008d] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:4982
 
  at System.Windows.Forms.XplatUIX11.SetWindowPos (IntPtr handle, Int32 x,
Int32 y, Int32 width, Int32 height) [0x000d4] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:5466
 
  at System.Windows.Forms.XplatUI.SetWindowPos (IntPtr handle, Int32 x, Int32
y, Int32 width, Int32 height) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:1066
 
  at System.Windows.Forms.Control.SetBoundsCore (Int32 x, Int32 y, Int32 width,
Int32 height, BoundsSpecified specified) [0x00028] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4932
 
  at System.Windows.Forms.ListBox.SetBoundsCore (Int32 x, Int32 y, Int32 width,
Int32 height, BoundsSpecified specified) [0x00032] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1066
 
  at System.Windows.Forms.Control.SetBounds (Int32 x, Int32 y, Int32 width,
Int32 height, BoundsSpecified specified) [0x000e8] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4381
 
  at System.Windows.Forms.Control.set_Height (Int32 value) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:2893
 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.Control:set_Height (int)
  at TextBoxLines+<>c__CompilerGenerated6.<Main>c__8 (System.Object +5,
System.EventArgs +6) [0x00032] in d:\Documents and Settings\alan\My
Documents\Suppliers\Mono\WinForms\ListControls\ListBoxHeight.cs:57 
.. ...
]]

[[

Unhandled Exception: System.DivideByZeroException: Division by zero
  at System.Windows.Forms.ListBox.EnsureVisible (Int32 index) [0x000a9] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:2034
 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.ListBox:EnsureVisible (int)
  at System.Windows.Forms.ListBox+SelectedIndexCollection.AddCore (Int32 index)
[0x000b3] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:2615
 
  at System.Windows.Forms.ListBox+SelectedIndexCollection.Add (Int32 index)
[0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:2590
 
  at System.Windows.Forms.ListBox.set_SelectedIndex (Int32 value) [0x00050] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:516
 
  at System.Windows.Forms.ListBox.SelectedItemFromNavigation (Int32 index)
[0x00027] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1875
 
  at System.Windows.Forms.ListBox.OnKeyDownLB (System.Object sender,
System.Windows.Forms.KeyEventArgs e) [0x0014b] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1648
 
  at System.Windows.Forms.Control.OnKeyDown (System.Windows.Forms.KeyEventArgs
e) [0x0001c] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:6179
 
  at System.Windows.Forms.Control.ProcessKeyEventArgs
(System.Windows.Forms.Message& m) [0x0004a] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4665
 
  at System.Windows.Forms.Control.ProcessKeyMessage
(System.Windows.Forms.Message& m) [0x0001e] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:4710
 
  at System.Windows.Forms.Control.WmKeys (System.Windows.Forms.Message& m)
[0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5804
 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x0020c] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5364
 
  at System.Windows.Forms.ListBox.WndProc (System.Windows.Forms.Message& m)
[0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs:1135
 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:227
 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:208
 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00084] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:240
 
  at System.Windows.Forms.XplatUIX11.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs:3293
 
  at System.Windows.Forms.XplatUI.DispatchMessage (System.Windows.Forms.MSG&
msg) [0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs:576
 
  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
System.Windows.Forms.ApplicationContext context) [0x00359] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:908
 
  at System.Windows.Forms.Application.Run
(System.Windows.Forms.ApplicationContext context) [0x00014] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:694
 
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form mainForm)
[0x00000] in
/usr/local/src/mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs:682
 
  at TextBoxLines.Main () [0x00319] in ListBoxHeight.cs:81 
]]


-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to