![Quote](images/metro/blue/misc/quote_icon.png)
Originally Posted by
Sorry
ingon ani xa bro..
naa koy combo box sa main form, kung mo select na gani ko ug item gikan sa combo box,
mo appear dayon ang sub form, so adto nako mag input sa mga info., unya, kung mo click nako
sa button nga display nga naa sa sub form adto xa ma display sa listbox nga naa sa main form.
sakto ba?
basta ingon ana xa..
![Cheesy](images/smilies/cheesy.gif)
... Hi sorry, by the way, Im a newbie here in istorya..
Im working as a developer, in an IT company here in Cebu, no need to mention the comp, it wont matter man sad..
according to your post, you have a parent Form, then this form will load another form, then you would want to reflect the changes you made in the sub form to the parent Form.. I wont give you codes its for you to make, and trust me you'll enjoy coding it (learning).
lets call the first form or the calling Form the Main Form, and the form that will load the Sub Form.
So we have 2 forms the Main Form and the Sub Form. SubForm will only load when an event in the main form occurs. Like you said, a combo box, when you select items in the combo box the SubForm appears.
Now this means that the SubForm is only an object that is part of the MainForm. Now have you ever heard of event handling in .Net?, its easy in vb.net, but its complicated in C#. To give you an introduction to event handling, and to make it simple, ani lang, when you click a button, that is considered and event, ang event is Click.. now you might not notice naa na syay event handler which is pointing to a method, usually if your new to .net d nmo makita na nga code coz its on the designer partial class... labi na sa C#, in VB it is easy to identify if ang method ni handle og event, notice sa kilid sa method naay keyword nga Handles ObjectName.EventName..
Now in C#, as i said event handling is a bit complicated, you have to know what are delegates first, then create an object of delegate type then invoke that delegate. Its getting complicated, dli madala og suwat, ani nlang ang concept..
Your SubForm should have an event, this event will be handled by the MainForm, so when that event is raised by the SubForm, the MainForm will handle it and will know what to do with it, pero libog jud sya sa.. Dli jud madala og discuss if e type ra..
I can send you a sample code anyway.. please shoot me an email..
MDCuesta@interprisesolutions.com if naay kai pangutana, then ill send you the code.
PS: Asa ka nag skol dong?