form doesnt closes ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi al

iam working on teklogix terminal win ce.net using vs.net 2003. iam able to run the application and it is working fine. but my problem is whenever i open a new form, old form remains on the task bar and the new form opens as a new window. iam using the below code to open a new form and close the existing one

Dim frm As New frmSale
frm.ShowDialog(
Me.Dispose(

Please help me out if anyone has a solution for this
Thanks in advanc

Regard
Vamsi
 
ShowDialog will open as a new window - essentially it makes it a modal
dialog box, with the 'old form' as it's parent.
Personally I've enver managed to open and hide and then re-show forms -
I'm convinced there is a problem there (Giney Caughey was assisting on
such a subject around October 2nd this year, this group) and as such I
now run everything from a master form, showing the rest with
ShowDialog(), ensuring to only have one window with populated text at
any one time.
In theory, I'd assume:

'//show non-modal new form
Dim frm As New frmSales
frm.Show()

'// hide Old form
Me.Hide


Of course, then you need a way to re-show the original form when the new
one closes...

Appologies if this isn't helpful to you.


Paul
 
Varnsi,

The solution is to remove the title from the old form when you show the new
one, then restore it when the new one closes.
--
Ginny Caughey
..Net Compact Framework MVP

Vamsi said:
Hi all

iam working on teklogix terminal win ce.net using vs.net 2003. iam able to
run the application and it is working fine. but my problem is whenever i
open a new form, old form remains on the task bar and the new form opens as
a new window. iam using the below code to open a new form and close the
existing one.
 
Hi Ginn

Thanks for your quick response

I got the solution b

Dim frm As New frmSale
frm.Show(
Me.close() or Me.Hide(

In the above two cases, whether it is close or Hide, when i saw the task manager the old form is not running in the memory. So my problem is solved. but please let me know the best way.

Regard
Vamsi
 
Varnsi,

The best way is whatever works for you and for your app. ;-) It sounds like
you have a good solution already.
--
Ginny Caughey
..Net Compact Framework MVP

Vamsi said:
Hi Ginny

Thanks for your quick response.

I got the solution by

Dim frm As New frmSales
frm.Show()
Me.close() or Me.Hide()

In the above two cases, whether it is close or Hide, when i saw the task
manager the old form is not running in the memory. So my problem is solved.
but please let me know the best way.
 
Back
Top