Home Forums WinForms controls Other WinForms controls Very odd bug, is it related to WinButton?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #17996 |

    I have tree WinButtons in a form. They each have a dropdown which is shown, and the dropdown is a ListBox control. Note that I have the same control assigned to all three buttons as a dropdown control. Clicking on one button, and then clicking on another sometimes crashes the program with an ArgumentOutOfRange exception occurring in System.Windows.Forms. I’m pretty sure the root of the problem lies somewhere else, probably in my code (it always does! ;o)).

    I’ve been debugging this for ages though, and I’ve become almost bald from pulling hair. Any help would be duly appreciated. Should I assign seperate ListBoxes to the buttons? If so, why can’t I use the same? (the collection of items in the ListBox has to be rebuilt after each click on it anyway).

    Here’s the callstack:

    Specified argument was out of the range of valid values.
    Parameter name: Index 0 is out of range.

    at System.Windows.Forms.ControlCollection.get_Item(Int32 index)
    at Xceed.Editors.ResizableFloatingWindow.RecalculatePreferredRectangle(Int32 overEdgeExtra, GripLocation gripPosition, Rectangle rectangle)
    at Xceed.Editors.ResizableFloatingWindow.ReCalculateAutoDropDown()
    at Xceed.Editors.ResizableFloatingWindow.Relocate()
    at Xceed.Editors.WinButton.set_DroppedDown(Boolean value)
    at Xceed.Editors.WinButton.OpenDropDown()
    at Hellas.GUI.Forms.AddMember.dropDownButtonClick(Object sender, EventArgs e) in d:\my documents\programmering\hellas\gui\forms\addmember.cs:line 2047
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at Xceed.Editors.WinButton.OnClick(EventArgs e)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at Hellas.Program.Zeus.Main() in d:\my documents\programmering\hellas\program\zeus.cs:line 46

    Imported from legacy forums. Posted by macke (had 2770 views)

    Xceed Support
    Post count: 5658

    it is not recommended to use the same dropdown control in different dropdowns.
    Another thing you could try is our latest build which should prevent this from happening.


    Imported from legacy forums. Posted by Vince [Xceed] (had 315 views)

    User (Old forums)
    Post count: 23064

    I tried replacing the one dropdown control with one for each button and now it seems to work fine, thanks!

    Imported from legacy forums. Posted by macke (had 3641 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.