what's wrong?

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

private void buttonBrowse_Click(object sender, System.EventArgs e)

{

Domains dmn = new Domains ();

if (dmn.ShowDialog () == DialogResult.OK )

{

textBoxUserName.Text =
System.Environment.UserName ;

textBoxDomain.Text = dmn.DomainName ;

}



}



What is wrong with this code?

I press the OK button in the Domains form, but I don't get the result.



Hrcko
 
Hrvoje said:
private void buttonBrowse_Click(object sender, System.EventArgs e)

{

Domains dmn = new Domains ();

if (dmn.ShowDialog () == DialogResult.OK )

{

textBoxUserName.Text =
System.Environment.UserName ;

textBoxDomain.Text = dmn.DomainName ;

}



}



What is wrong with this code?

I press the OK button in the Domains form, but I don't get the result.



Hrcko

Are you sure that the button is attached to this code? If you're in
debug mode, can you verify that this code is executed?
 
Hrvoje said:
private void buttonBrowse_Click(object sender, System.EventArgs e)

{
Domains dmn = new Domains ();

if (dmn.ShowDialog () == DialogResult.OK )
{
textBoxUserName.Text =
System.Environment.UserName ;
textBoxDomain.Text = dmn.DomainName ;
}
}

What is wrong with this code?

I press the OK button in the Domains form, but I don't get the result.

In your Domains form have you set the DialogResult property on your OK
button to DialogResult.OK?
 
Hi,

What is Domains type?
Was it written by you ?, I have never see this class in the framework

Take a look at what ShowDialog returns
DialogResult result = dmn.ShowDialog () ;
if ( result == DialogResult.OK)
...



cheers,
 
Back
Top