Form1 doesn't give Form2 anything, Form1 simply opens Form2 when necessary, letting them be open simultaneously. Form2 is meant to display clickable strings(I mean URLs) frm xml files, thats all. Once anything is clicked, I want to close Form2 and let components() do its job on Form1. Yes components() adds a web browser on Form1, and no I don't need the browser on Form2, because Form1 has plenty other functions than just calling Form2. So basically I need to know how to link forms I guess? Or at least thats what I think I need to know.
DJdC
Posts
-
Please Help! Function on Separate Form -
Please Help! Function on Separate FormErrrmmm my components function won't have any xml codes. I wanted Form2 to handle all the xmls, and display whatever URL strings necessary, which are clickable, and on clicking it closes Form2 and Form1 runs the components function as per normal, of course with an extra code dealing with this string. The strings are meant to be URLs, and one of the things components() adds is a web browser window which I'd intend to use to navigate to the URL the Form2 string would suggest. I don't know, the logic just seems very clear cut to me I really don't intend to confuse you. And at this point, haha, I won't bother abt how nice my code looks, as long as it works and I understand everything when presentation time comes hahaha.
-
Please Help! Function on Separate FormOkay Christian. Its a Windows Application that uses the internet but its nothing to do with ASP.NET . A C# Windows Application. webtest is just the name I gave it I'm sorry if this threw you off. I'm sure you're very familiar with Windows Applications integrating Google APIs? Yes I'm doing this as a project in school. Program works fine, nothing fancy, but I have a new requirement now you see, Supervisor gave me a task to save and retrieve information onto xml files. I haven't really mastered xml but I would later on when I got the foundation to practise with! Form1 is the actual application, I'd make a menu for the user to retrieve saved files via Form2, cause I don't wanna trouble myself of removing everything from Form1 so the user can see my xml information. Form2 is meant to display URLs, of which they are clickable and Form2's job is done. And that my friend is the logic I came up with. You might want to suggest another alternative but I can safely say it would just throw my fragile understanding in the bin, I'm an amateur in programming and I've only touched C# in April haha.
-
Please Help! Function on Separate FormHey Christian, OnInit?lifecycle?viewstate? Dude it now seems like my problem is more than I can bare haha. The thing is Form2 has information that Form1 doesn't and sometimes I'd need to pass values too Form1, but first I need a way to link them I guess? They both belong to the same project but Form2 isnt able to call the function. I believe by simply calling the function to be performed as per normal, half my battle is won. Dave said to see posts regarding adding a reference of Form1 to Form2 or something like that? I'm not sure how or if this is it. Thanks man! Please reply!
-
Please Help! Function on Separate FormHey man, I'm not so sure of what's meant to be obvious, I'm pretty new to programming, ESPECIALLY with C#, student you see, haha... I use Visual Studio.NET 2003 and these forms are both part fo the same project. They belong to the same namespace called webtest, which is the project name right? Yes and my function is on Form1 and it adds components to itself and I need it for Form1 at some time to call this for itself. But for many reasons now I need Form2 to be able to call Form1's function to be performed as per normal on Form1. Its not really something to share as in the same function to be performed on Form2 thats not what I meant. I just need Form2 to call the function for it to be performed as per normal... So on Form2's code I guess I'd need something like private void pictureBox1_Click(object sender, System.EventArgs e) { //Code here } Please help man! Thanks :)
-
Please Help! Function on Separate FormHey Dave, I'm not sure if I understood your solution? Separate my function into a library? Well you see its a function that just adds components to Form1, and it is written on Form1's class and works perfectly fine with a click of anything But yes I posted this question cause now I ALSO need Form2 to be able to call this same function for it to work as per normal on Form1. They both belong to the same namespace webtest and I use Visual Studio 2003... Please help man, thanks!
-
Please Help! Function on Separate FormHey man thanks for the suggestion, you make quite alot of sense and I think its exactly what I need to do but unfortunately it still doesn't work. The function is just simply not called. So I took your advice and I did private void button1_Click(object sender, System.EventArgs e) { Form1 form = new Form1(); form.components(); this.Close(); } in Form2 and only my Form2 closed without Form1 doing what it was suppose to do. It basically adds a shitload of components to itself with this.Controls.Add and yeah it didn't work. Or if you think its quite crap, still not even this works private void button1_Click(object sender, System.EventArgs e) { Form1 form = new Form1(); form.Close(); this.Close(); } even though both times were ABLE TO BE COMPILED. so maybe you might have a suggestion as to why? May I'm not doing my classes or namespace or the USING commands properly. Both forms belong to a namespace called webtest and the classes Form1 and Form2 are on different pages using Visual Studio 2003. Please help man, I'd very much appreciate it, thanks! :-D
-
Please Help! Function on Separate FormThanks Cadi for the swift reply! Yes I understand what you were saying on the top but your program doesn't really go with my understanding, especially the bottom part, because it looks like its reopening form2? But both forms are open already and I need for form2 to get form1 to run its function called components. Maybe you could explain your program abit more? Thanks!
-
Please Help! Function on Separate FormHey thanks man for replying so fast, but I'm not quite sure if we're on the same page haha... Okay you see, both forms are open and no, form1 doesn't create form2, just opens it with simply a form2 form = new form2(); form.Show(); I need to use this function called "components". On form1 I would just simply call this function with simply components(); but because I need now for form2 to execute this function ON FORM1 as per normal, it won't let me cause components doesn't exist on form2. Okay yes I'm very blur so here's sort of a 'template' to help me understand better. private void pictureBox1_Click(object sender, System.EventArgs e) { //please enter code here if its meant to be here thanks! }
-
Please Help! Function on Separate FormI have 2 forms, form1 and form2. form1 has a function called components. I need now, for form2 to execute this function on form1 as per normal. I have no clue on form linking, please help me! Thanks!