Can I copy form1.cs and and create few more forms just like it -only connected to different tablels in microsoft acces database
thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ArloPosted Feb 2, 2010, 4:26 PM
ArloPosted Feb 2, 2010, 4:23 PM
theLizardPosted Feb 2, 2010, 3:29 PM
This can be done a couple of ways 1. make a copy of the form for each of the tables from the database you want the form to access (not the best way) OR you could dynamically create them as children of the MDI (a more preferred way). This would be the best way but you would need to code your form to be generic in nature, this means that you DO NOT code the form for a specific table, you parse the table at run time and let the form handle the needs.
To do it this way you need to know exactly how you want to show your data, how your users will interact with them and then write generalized classes to do your bidding.
You need to decide what common fields or dynamic fields will show on the form either in static controls or dynamically created controls at run time on the forms.
So your question, can you copy a form from 1 to another form, answer is yes the how depends on the why and how much effort you want to put into it.
Remember, the shortest road is not always the quickest way to get there.
ArloPosted Feb 2, 2010, 3:16 PM
I have a form with alot of textboxes and buttons already created - I thought maybe there is a way to copy it so - I don't have to recreate the whole gui again-
maybe copying the code I can will recreate gui- thats what i am reading- or your best guess estimate of what i am asking-
thank you
Sam HobbsPosted Feb 2, 2010, 12:10 PM
I don't like to guess since people often tell me I am wrong when I guess wrong, and they say it as if I should have been psychic and knew what they need. My best guess of what you need to do is that you need to modify the form so that it can use different tables.
If you want to copy the form source code at design time and modify the table that each uses, why not try doing that? You can create a separate project for testing purposes. You won't break the computer. You must do things like that to learn.
ArloPosted Feb 2, 2010, 8:01 AM
not really sure
Sam HobbsPosted Feb 1, 2010, 9:38 PM