ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,406 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,604 people online right now. Registration is fast and FREE... Join Now!




C# tabcontrol loading tabs problem

 

C# tabcontrol loading tabs problem, tab loading 3 times at startup.

Servatis

22 Jun, 2009 - 02:39 AM
Post #1

D.I.C Head
**

Joined: 30 Mar, 2009
Posts: 185



Thanked: 1 times
My Contributions
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.

User is offlineProfile CardPM
+Quote Post


PsychoCoder

RE: C# Tabcontrol Loading Tabs Problem

23 Jun, 2009 - 06:59 AM
Post #2

Dyslexics Untie!
Group Icon

Joined: 26 Jul, 2007
Posts: 14,714



Thanked: 501 times
Dream Kudos: 11450
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
First off I'm moving this to the ASP.NET forum (it belongs there since you're referencing the Form_Load event). Second, show us the code that is causing the issue(s). It's hard (near impossible) for us to help if we cannot see how you're accomplishing this smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 10:43PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month