|
Hi,
So this is not a very big problem. the program works fine but; I have an application that has some option to dynamically change some settings for example I change the language setting and the current tab page gets reloaded with the right language.
now at start-up the application loads the first tab but then the application loads the language method effectively reloading the page again. also in the Form_Load method at the end the application runs through all tabs loading the information, because if I dont do this and certain settings are changed they will not be carried over to the other tabs. for example I load the app, I immediately, without accessing tab 2 or 3, change a setting called MXorSX, and I then switch to tab 3 the old data will still be displayed until I deliberately select the data that I want displayed, the only solution I found was to access all tabs when the app is loaded.
what this does is it loads tab 1, 3 times when the application is started. because the app starts at tab 1 it gets loaded the first then the language method is called along with all other methods that need to be used at startup and then at the end of Form_Load it runs through all tabs again.
Now I can prevent the app from loading the tab when the language method is called with a simple bool.
but then it still gets loaded 2 times which is 1 to many.
in my code I only call on tab 1 once, so I'm assuming that there is some code somewhere that, when the app is started, loads tab 1, then my code loads everything that is needed and I again load tab 1. tab 1 doesn't necessarily have to be loaded until I call for it.
is there a way to prevent it from loading before Form_Load is called. or is there a reason for it loading before anything else?
I'm not posting code because it's quite a lot and only a few lines matter. if you do want to see some code then ask, but I don't think it will be much help.
I hope I explained it correctly.
thanks.
|