How can I change the value of a passed-in parameter's value?
Posted on 2006-11-06
Hi, I have a couple of ref string input variables that I would like to change their value in the Dialog Window but my code below is not able to do that. I created the string loginID=null, pswd=null, defUserID;
variables to store the parameters but when I change the value in the btnOK_Click routine, the calling program doesn't receive the new value. Thanks.
public partial class frmUserIDPassword : Form
string loginID=null, pswd=null, defUserID;
public frmUserIDPassword(ref string userID, ref string Password, string defUserName)
loginID = userID;
pswd = Password;
defUserID = defUserName;
private void btnOK_Click(object sender, EventArgs e)
loginID = txtUserName.Text;
pswd = txtPassword.Text;