Strange behaviour after maximizing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RXJpYw==?=

    #1

    Strange behaviour after maximizing

    My program is a call duty planning tool.
    It has a splitter with the two panels horizontally split.
    The upper panel has a month selector, 3 buttons, 3 labels and a datagridview.
    The lower panel has only a datagridview.

    The buttons are for navigation.
    The upper grid show three text columns, then between 35 and 40 image columns.
    The lower grid has 1 text column as wide as the first four of the upper grid
    and then an equal amount of image columns.

    When the program starts, it show the planning based on the data stored in
    the sql database. The main window is not maximized to the screen.
    With the buttons I can now go through the months, show the data with it.
    This runs fine even if I do it several times.

    Now I maximize the main window. The splitter panels are anchored to the
    sides of the form, so everything grows.
    Some extra columns are added at the right to fill up the space.

    If I now move through the months, I get the following error on the second,
    third or more month changes.

    "Exception has been thrown by the target of an invocation"

    Here is the code where the error is shown:

    If rw("callduty") = True Then
    If rw("holiday") = False And rw("training") = False Then
    If rw("cdregion") = "north" Then
    dgDays.Item(kol om, ab).Value = My.Resources.Ca llDuty_North
    If rw("comment").T oString.Length 0 Then dgDays.Item(kol om,
    ab).Value = My.Resources.Ca llDuty_North1
    End If
    end if
    end if
    end if

    The error occurs on the line starting with dgDays.

    The resources used are Icons.



    So why is this happening. How can I figure out what is causing this?
    It's quite annoying.

    please help.
    Eric





Working...