Refresh WinForm after On_Load

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

    Refresh WinForm after On_Load

    Not sure the easiest way to ask this so I will give a small example of
    what I want to accomplish.

    Create a VB.Net WinForm Application with two forms. On the first form,
    two textboxes and a button that hides the current form and shows the
    second form. On showing the second form for the first time the
    On_Form_Load event is kicked off and the data in the two textboxes is
    added up and displayed in a label. A button on the second form allows
    you to hide the current form and show the first form again. After
    going back to the first form, change the data and hit the button to go
    back to the second form. At this point the On_Form_Load event does not
    kick off and the new data is not summed. Is there a way to
    programmaticall y kick this event off when the user goes back to the
    second form?

    Thanks

  • Brian Delahunty

    #2
    RE: Refresh WinForm after On_Load

    There are a number of different events that you could put your code in, for
    example:

    GotFocus
    Paint
    Activated

    Try putting the code in one of these events instead of in the Form Load event.

    Hope this Helps

    Brian Delahunty

    "Will" wrote:
    [color=blue]
    > Not sure the easiest way to ask this so I will give a small example of
    > what I want to accomplish.
    >
    > Create a VB.Net WinForm Application with two forms. On the first form,
    > two textboxes and a button that hides the current form and shows the
    > second form. On showing the second form for the first time the
    > On_Form_Load event is kicked off and the data in the two textboxes is
    > added up and displayed in a label. A button on the second form allows
    > you to hide the current form and show the first form again. After
    > going back to the first form, change the data and hit the button to go
    > back to the second form. At this point the On_Form_Load event does not
    > kick off and the new data is not summed. Is there a way to
    > programmaticall y kick this event off when the user goes back to the
    > second form?
    >
    > Thanks
    >
    >[/color]

    Comment

    Working...