Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a app that has times hard coded, i would like to copy that app change the times and add it back. so now when i run the app i can select run app 1 or run app 2. How would i do that?

basically I want to take the same program and lay it inside of the original but with different information.

Thanks

What I have tried:

looking around the net but i really dont know what verbiage to search for.
Posted
Updated 21-Jan-17 8:14am
v2
Comments
[no name] 21-Jan-17 10:37am    
"I have a app that has times hard coded, i would like to copy that app change the times and add it back."

Not clear, at least to me (a none native): "time", what you mean with this?

" so now when i run the app i can select run app 1 or run app 2. How would i do that?":
An app where you can start abother app 1...M should not be a big Problem.

Please clarify.
Member 12349103 21-Jan-17 10:52am    
to add the same program to the existing program but code in the different program is modified. do i do a simple Add to existing Item to the solution?
[no name] 21-Jan-17 10:55am    
Sorry, I don't understand :(
Dave Kreskowiak 21-Jan-17 11:06am    
Considering we know NOTHING AT ALL about your application and what it does and what you mean by "has times hard coded" and what you mean by "copy that app change the times and add it back", it's impossible for anyone to help you.

You basically just jumped into a room where nobody has ever heard of you before and spouted this post without providing any context information at all. Now everyone in the room is staring at you wondering what the "elephant" you're ranting about.
Member 12349103 21-Jan-17 11:17am    
Apology

I have a Winform that calculates x amount of boxes and divides it but minutes in a day if it runs into a time that i have coded (Lunch) it skips that amount of time then finishes the calculation. I would like to have the same app but with different times that i hard code.The user can select app 1 or app 2 from lets say a splash screen. Do i add the 2nd app to the solution project and add click events?

You do not need two different apps. You just need to provide a menu choice or button selector to allow the user to select one or other set of times. You could even do it with a single MessageBox. Then inside the app just select whichever set of times the user has indicated.
 
Share this answer
 
Comments
Member 12349103 21-Jan-17 12:51pm    
Thanks for the tips Home work time.
If you want 2 different apps then you need to make 2 separate projects that will be compiled into 2 executables.

If you want the ability to run 2 different forms depending on a selection, then add 2 new forms to the original project (assuming you already have the one)= 3 total, one being for placing buttons or links that the user will select to pick which "app" to run. The other forms are those with the hard coded values. One link/button/etc opens "app1", the other link/button/etc opens "app2".

And yes event handlers will be needed to handle the click events.
 
Share this answer
 
I have to laugh because you're spelling out precisely why you're in this problem. You keep saying that you "hard coded" things into your app now you want to know how to make another form with different "hard coded" values.

DO NOT DO THAT!!!!!! Hard coding values locks you into the very situation that you're in!!

What you should have done is put these values into a configuration file and then loaded them as required for different situations. Now you only need one form that can handle these various situations. All you have to do is supply a menu item to pick which set of values to load from the configuration file into the form.
 
Share this answer
 
Comments
Member 12349103 21-Jan-17 21:56pm    
Dave very true statement, i am in the process of converting it with a csv helper. I am new to this took me 3 mo. to get it working the whole app is math calculations. I have learned alot in this journey. can you elaborate more on a configuration solution? I dont mine home work just need a direction.

thanks
Member 12349103 22-Jan-17 14:23pm    
Thanks guys it is user friendly now.
Thanks again for the tips

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900