Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1

    Question nid elp.. (c#.net newbie)


    mga bro. unsa.on man nako pag display sa akong total nga akong gi input gikan sa subform ngadto sa main form.?
    unsa man ang code? or unsa man akong buhaton?

  2. #2
    Quote Originally Posted by Sorry View Post
    mga bro. unsa.on man nako pag display sa akong total nga akong gi input gikan sa subform ngadto sa main form.?
    unsa man ang code? or unsa man akong buhaton?
    create a reference of your main form from you sub form...
    just pass the value from the sub form to your main form

  3. #3
    Sa Main.cs
    Public string test;

    Sa Form1/Subform.cs na event or function na mupass

    Main myParent = this.Parent;
    myParent.test = "hello";
    or...
    ((Main)Parent).test = "hello";

  4. #4
    Quote Originally Posted by DeathFox View Post
    Sa Main.cs
    Public string test;

    Sa Form1/Subform.cs na event or function na mupass

    Main myParent = this.Parent;
    myParent.test = "hello";
    or...
    ((Main)Parent).test = "hello";
    yup just like that
    but you can also reference the control para display dayon ang g.pasa nimo na value

  5. #5
    Quote Originally Posted by skillzdx View Post
    yup just like that
    but you can also reference the control para display dayon ang g.pasa nimo na value
    Nope, he cant reference the control directly if he used the drag and drop method in creating the controls

  6. #6
    Quote Originally Posted by DeathFox View Post
    Nope, he cant reference the control directly if he used the drag and drop method in creating the controls
    actually he can
    this is a drag and drop method
    you have much more control rather than having them dynamic
    form2:
    public TextBox tx; 'reference of the control
    private void button1_Click(object sender, EventArgs e)
    {
    tx.Text = textBox1.Text;
    }
    form1:
    private void button1_Click(object sender, EventArgs e)
    {
    Form2 frm = new Form2();
    frm.tx = textBox1;
    frm.Show();
    }
    in this scenario the value you pass instantly shows on the textbox or which ever control you want to
    if you only reference the parent form you cant call its controls
    create a reference for the control you want to pass the value with

    dont know if this is what he wants,

  7. #7
    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..

  8. #8
    Quote Originally Posted by skillzdx View Post
    actually he can
    See what you did, instead of making learn on his own by providing a simple example... imung gihatagan ug completo na. So na, gapagama na nuon sa exactly what he needs :P

  9. #9
    sori mga bro.
    bag.ohay pa lang jud ko nag learn aning
    c#.net .. as in wla pa jud ko knowledge
    anang mga butanga ..

  10. #10
    Quote Originally Posted by skillzdx View Post
    actually he can
    this is a drag and drop method
    you have much more control rather than having them dynamic
    form2:
    public TextBox tx; 'reference of the control
    private void button1_Click(object sender, EventArgs e)
    {
    tx.Text = textBox1.Text;
    }
    form1:
    private void button1_Click(object sender, EventArgs e)
    {
    Form2 frm = new Form2();
    frm.tx = textBox1;
    frm.Show();
    }
    in this scenario the value you pass instantly shows on the textbox or which ever control you want to
    if you only reference the parent form you cant call its controls
    create a reference for the control you want to pass the value with

    dont know if this is what he wants,


    Hi Im a newbie here in istorya.net, im actually a software developer..i dont think creating object reference wold be the solution. magka complicate sya if daghan ipasa, so daghan fud reference.. hmmm... anyways..

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. Replies: 1329
    Last Post: 05-11-2024, 12:34 PM
  2. asp.net c# newbie..pls help..
    By shawn87chau in forum Programming
    Replies: 15
    Last Post: 11-26-2008, 10:44 AM
  3. NEWBIE here...Kung nid nyo Windows Mobile APPS just PM me...
    By maverick_007 in forum Gizmos & Gadgets (Old)
    Replies: 0
    Last Post: 11-14-2008, 09:39 PM
  4. hi guyz .. nid elp about notepad++
    By Sorry in forum Programming
    Replies: 13
    Last Post: 10-15-2008, 09:45 PM
  5. bro. i nid a lil elp...
    By deathrow in forum Websites & Multimedia
    Replies: 12
    Last Post: 02-25-2008, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top