Device hangs.

  • Thread starter Salil.Khanwalkar
  • Start date
S

Salil.Khanwalkar

Hi,
When i click on the Close(x) button(upper right corner) , my
application does not exit completely , i have to use the HP Task
Swithcher program in order to close it. Now if i again try to execute
the program my device hangs, and i have to soft reset it.
There is a Form_Ok event in eVB, is it present in c# and .net cf?

I have a HP iPAQ rz 1710.

Here is the code - I am assuming that the Form_Closed() event will be
called when the Close button is clicked.

private void Form1_Load(object sender, System.EventArgs e)
{
openPort();
}

private void Form1_Closed(object sender, System.EventArgs e)
{
closePort();
}

public void openPort() {
try
{
if (port.IsOpen == true)
{
MessageBox.Show("Port already open");
}
else
{
if(port.Open() == true)
{
//MessageBox.Show("Port opened");
}
}
}
catch(CommPortException e) {
MessageBox.Show (e.ToString());
closePort();
}
}

public void closePort() {
if(port.Open()){
port.Close();
port.Dispose();
}
}
 
G

Guest

Sure, that's expected behavior. The (X) is a minimize button so your app
shouldn't close. If you want it to close, set the Form's MinimizeButton
property to "false" and the button will change to (ok) and close the Form.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top