Question How do i start a file with input from a textbox

Floppydisk

New member
Joined
Oct 1, 2018
Messages
2
Programming Experience
Beginner
Hello all, so first of all i'll say i'm a beginner, though i'm learning rapidly. However this thing has me stumped. I found some solution but these seemed overly complicated.
Anyways here is my problem.
I'm currently creating an windows form app that has multiple forms. Form1 is the actual app Form 2 is for filepath input (these go into settings)

What i want to do now is use the filepath from the textbox on form2 so i can start the .exe on form 1 with a button

If some1 could tell me this can indeed be done reasonably simple i would be overjoyed.

Greetz Floppy
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,741
Location
Sydney, Australia
Programming Experience
10+
All you're talking about is passing a String from one form to another. Yes, that can be done simply. What some people consider simple is a bit unrealistic sometimes though. I suggest that you follow the Blog link in my signature and check out my three-part post on Data Among Multiple Forms.
 

Floppydisk

New member
Joined
Oct 1, 2018
Messages
2
Programming Experience
Beginner
Thanks a lot for the quick responce an will do. When i started with this c# coding i was slowly creating something, and the coding started to make sense. I thought i was beginning to see some logic in it.
When i ran into this however i had expected a simple solution like i have info A i know how to start B so i just put a and b together and bingo, but no seems like i have to create a C,D and E to get there.

I will read through your blog Thanks a bunch

Floppy
 

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
2,741
Location
Sydney, Australia
Programming Experience
10+
Programming isn't just a bag where you throw a bunch of things and magic happens. You have to follow certain structure. The sort of thing you describe would take me about 30 seconds so to imply that it's an onerous task isn't really accurate. It's like if someone asked me to drive to the shop it would be a no-brainer but for someone who didn't know how to drive it would be a big deal. All you really need to do is call a method and pass a String as an argument so it's nothing, but if you expect to have a method to call to do something useful to you then you need to write that method first. Visual Studio can't read your mind and magic a method to do the job you want done. You write the code to perform the past you want performed, then you invoke that code and pass in the required data. It IS simple. But even simple things aren't necessarily easy when you first encounter them.
 
Top Bottom