hi
you do not keep the textbox, you keep the loginname.
and USR CANNOT be a global variables as there is not such a thing in C# :)
use somethign like this:
class CurrentUser
{
static string loginname="";
static public string Login{ get{ return loginname;} set { loginname=value ;}}
}
then in your auth dialog, after you check that the login/password is correct
you do:
CurrentUser.Log in = boxUserName.Tex t;
after that the login is accesible globally as CurrentUser.Log in
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<ro****@tauex.t au.ac.il> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
This is not such agood idea, as the veriable will not keep the name
after function is through.
note: I call USR from a different form
this is the function:
private void btnOK_Click(obj ect sender, EventArgs e)
{
DAL dal= new DAL();
if (dal.userExists (boxUserName.Te xt,
Int32.Parse(box Password.Text)) ==true)
{
this.DialogResu lt = DialogResult.OK ;
}
else
MessageBox.Show ("Wrong username or password. Please try again or open
new user");
USR=boxPassword .Text.ToString( );.Text.ToStrin g();
}
tried it and it wasn't useful.
P.S: USR is global variable.