none
Reload form

    Question

  • Hello friends,
    I am trying to figure out a way to reload a form which loads its form element settings from an access database file. Once the form is used to update its settings nothing on the form itself updates, obviously because I need to reopen the form then it works, but is there a way I can reload this form, so that one doesn't have to close and re-open the program?

    Thanks,
    Ilya
    Friday, August 14, 2009 12:05 AM

Answers

  • Well there is no inbuilt way but you can always close and reopen the form and keep the code to load the settings in Form.Load event? Or simple keep a Timer control which will keep updating the settings at a specified interval of time, that way no need to reload the form :)

    Hope that helps :)

    Life would have been much easier if I had the source-code !!
    Friday, August 14, 2009 4:19 AM
  • Hi,

    Databind the form element against variables that will be updated later on.  Set up the binding so that the form elements automatically adjusts when the bound values are updated.

    A couple of articles to help you on the way

    [Windows Forms Data Binding]
    http://msdn.microsoft.com/en-us/library/ef2xyb33.aspx

    [Data binding concepts in .NET windows forms]
    http://www.codeproject.com/KB/database/databindingconcepts.aspx


    ---
    Happy Coding!
    Morten Wennevik [C# MVP]
    Friday, August 14, 2009 5:42 AM

All replies

  • Well there is no inbuilt way but you can always close and reopen the form and keep the code to load the settings in Form.Load event? Or simple keep a Timer control which will keep updating the settings at a specified interval of time, that way no need to reload the form :)

    Hope that helps :)

    Life would have been much easier if I had the source-code !!
    Friday, August 14, 2009 4:19 AM
  • Hi,
    Try form activate event .i hope it will help you
    Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
    Friday, August 14, 2009 5:40 AM
  • Hi,

    Databind the form element against variables that will be updated later on.  Set up the binding so that the form elements automatically adjusts when the bound values are updated.

    A couple of articles to help you on the way

    [Windows Forms Data Binding]
    http://msdn.microsoft.com/en-us/library/ef2xyb33.aspx

    [Data binding concepts in .NET windows forms]
    http://www.codeproject.com/KB/database/databindingconcepts.aspx


    ---
    Happy Coding!
    Morten Wennevik [C# MVP]
    Friday, August 14, 2009 5:42 AM
  • I set up the timer, it was the easiest way. However because it has to now update from Database every second it wastes a lot of the CPU time. 
    Is there a way to pass on to the initial form something from the update form to let it know that things changed? The main form calls the update form using the ShowDialog method.

    Thanks again.
    Friday, August 14, 2009 7:01 PM
  • This will help you..

    http://www.codeproject.com/KB/database/chatter.aspx

    Goodluck.
    Life would have been much easier if I had the source-code !!
    Saturday, August 15, 2009 7:19 PM