SystemArgumentException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lgbjr

    #1

    SystemArgumentException

    Hi All,

    I have a VB.NET MDI app that uses some 3rd party controls (CSTSoft) on some
    of the MDI child forms. If I remove the control, all works fine. But, with
    the control, I get a SystemArgumentE xception:

    System.Argument Exception: Invalid parameter used.
    at System.Drawing. Bitmap..ctor(In t32 width, Int32 height, PixelFormat
    format)
    at System.Drawing. Bitmap..ctor(In t32 width, Int32 height)
    at CSTPercent.Perc ent.b()
    at CSTPercent.Perc ent.OnResize(Ev entArgs e)
    at System.Windows. Forms.Control.O nSizeChanged(Ev entArgs e)
    at System.Windows. Forms.Control.U pdateBounds(Int 32 x, Int32 y, Int32
    width, Int32 height, Int32 clientWidth, Int32 clientHeight)
    at System.Windows. Forms.Control.U pdateBounds()
    at System.Windows. Forms.Control.W mMove(Message& m)
    at System.Windows. Forms.Control.W ndProc(Message& m)
    at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
    at System.Windows. Forms.Container Control.WndProc (Message& m)
    at System.Windows. Forms.UserContr ol.WndProc(Mess age& m)
    at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
    at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
    at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
    IntPtr wparam, IntPtr lparam)

    I've hunted around on the web and found that exception is actually being
    caused by a known bug in the 1.1 framework.

    What I'd like to do is catch this exception, but I have no idea where to
    catch it. The actual exception occurs when I minimize the MDI child (if I
    minimize the MDI parent, there's no exception).

    TIA
    Lee


  • lgbjr

    #2
    Re: SystemArgumentE xception

    Hi All,

    I'm not having any luck trying to catch this exception. since the exception
    occurs when the child form is minimized, I've tried adding a Try..Catch
    block to the Resize and SizeChanged events, but that's not working.

    If I run the executable outside the IDE, I get the unhandled exception and
    if I continue, all works. If I run the app from the IDE, when the exception
    occurs, it actually points to the MDI parent form class.

    Where and how do I put an exception handler for this?

    TIA,
    Lee

    "lgbjr" <lgbjr@nospam.c om> wrote in message
    news:%23EJJOz%2 3vFHA.4032@TK2M SFTNGP15.phx.gb l...[color=blue]
    > Hi All,
    >
    > I have a VB.NET MDI app that uses some 3rd party controls (CSTSoft) on
    > some of the MDI child forms. If I remove the control, all works fine. But,
    > with the control, I get a SystemArgumentE xception:
    >
    > System.Argument Exception: Invalid parameter used.
    > at System.Drawing. Bitmap..ctor(In t32 width, Int32 height, PixelFormat
    > format)
    > at System.Drawing. Bitmap..ctor(In t32 width, Int32 height)
    > at CSTPercent.Perc ent.b()
    > at CSTPercent.Perc ent.OnResize(Ev entArgs e)
    > at System.Windows. Forms.Control.O nSizeChanged(Ev entArgs e)
    > at System.Windows. Forms.Control.U pdateBounds(Int 32 x, Int32 y, Int32
    > width, Int32 height, Int32 clientWidth, Int32 clientHeight)
    > at System.Windows. Forms.Control.U pdateBounds()
    > at System.Windows. Forms.Control.W mMove(Message& m)
    > at System.Windows. Forms.Control.W ndProc(Message& m)
    > at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
    > at System.Windows. Forms.Container Control.WndProc (Message& m)
    > at System.Windows. Forms.UserContr ol.WndProc(Mess age& m)
    > at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
    > at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
    > at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
    > IntPtr wparam, IntPtr lparam)
    >
    > I've hunted around on the web and found that exception is actually being
    > caused by a known bug in the 1.1 framework.
    >
    > What I'd like to do is catch this exception, but I have no idea where to
    > catch it. The actual exception occurs when I minimize the MDI child (if I
    > minimize the MDI parent, there's no exception).
    >
    > TIA
    > Lee
    >[/color]


    Comment

    Working...