c# getting a value from a databound formX.txtbox into formY.txtbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mailbox73
    New Member
    • Nov 2008
    • 2

    c# getting a value from a databound formX.txtbox into formY.txtbox

    Hi,

    c# 2008 express edition.

    Can anyone please help me figure out why I cannot get any value from one form to another when the controls are databound. (the formY.txtbox lands up empty)

    in formY I write in the load event:

    Formx frmx = new Formx();
    txtCustomer.Tex t = frmx.customerId TextBox.Text;

    ....(customerId TextBox is public and shows up in intellisense).


    please advise as I am a newbie and have been stuck for the past 8 hours and can only get values if the txtbox is not databound.

    Thanks in advance
  • mailbox73
    New Member
    • Nov 2008
    • 2

    #2
    Answer

    in form2:
    public string custID;

    ----------

    in form1:

    button1 click event
    {
    form2 f=new form2();
    f.custID=this.t xtCustID.text;
    f.show();
    }

    ------------------

    Comment

    Working...