Windows Develop Bookmark and Share   
 index > Windows Forms General > Form Controls?
 

Form Controls?

Windows form troubles. 

I created a simple win form that imports various file formats into my database. I initially created all the logic on one page until I was told that would be 30+ different file formats that I needed to parse. With that I decided to*space
space*up all the routines into seperate classes for ease of understanding and upgrading later. 

All that works like a champ, except. 

On the main page I have a progressbar, and a statusbar that worked when all the logic was on the main page but now that it is in classes these things just sit there. 

I have tried to inherit from the main page and use them that way but no luck. 

Anyone able to help me out here? Its not imparative for this application to work but I think it would be nice to have so that users know what is going on. 

Thanks 
MigrationUser 1  Tuesday, June 15, 2004 3:03 PM
I am a little confused by your problem. You say you broke everything into separate classes. You mean ordinary classes, correct, not form classes? So what is the problem exactly? You have a single windows form, that no longer updates the progress bar and status bar. I don't understand what this problem has to do with the factoring of the code into separate classes. Perhaps you need to periodically call Application.DoEvents, to update the UI?
MigrationUser 1  Wednesday, June 16, 2004 4:09 PM
I think the problem is that when all the logic was in the form the progress bar could be updated because the progress bar was a member of the class that was executing the logic (the Form class).  Now that the logic is in different classes, they dont have access to that progress bar anymore...if Im wrong about whats going on here let me know...anyway, one thing you could do is pass a reference to the progress bar on the form into your class thats parsing these files so it can update it as its parsing.  Another thing you could do is maybe add an event to your class thats doing the parsing and fire it when you are at a good point to update a progress bar.  Then the form would catch that event and update the prgress bar itself...hope this helps...
MigrationUser 1  Friday, June 18, 2004 1:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Console Output from a Windows Form
• Change color and backcolor of the caption of Tab page
• Databinding "Fun" with Interfaces...
• Windows Live Messenger Music Plug-in Problem
• How to make the Leave event fire on a control on dispose
• Initiate different form through event.
• Halting a user initiated windows shutdown in C# using WndProc
• Determining "Text Changed" in text box...
• What's the purpose of 'PreviewKeyDown ' event?
• to access checkbox in a DataGridView