Hi Edward,
Thanks for the reply. Your approach looks great except for one issue - I'm
curious - when you show your forms, are you sure you're using 'Show()'
instead of 'ShowDialog()'? If you're using .Show, then don't you need to
set e.Cancel = true in your frmNumericTextBox_Closing handler, so that you
can reuse the form?
If you'd like to send me a complete repro - I'll take a look at it...just
remove the 'online' out of the email address.
Thanks,
-Katie
This posting is provided "AS IS" with no warranties, and confers no rights.
***.Net Compact Framework Info***
Faq:
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/netcf/FAQ/default.a
spx
QuickStarts:
http://samples.gotdotnet.com/quickstart/CompactFramework/
Samples:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/CompactfxTechArt.asp
--------------------
| Content-Class: urn:content-classes:message
| From: "Edward Fernandes" <
[email protected]>
| Sender: "Edward Fernandes" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: RE: Problem with .Net Compact Framework SP2
| Date: Tue, 6 Jan 2004 05:27:33 -0800
| Lines: 153
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcPUWNfJ0q4pGeI8Q0exCQ/AB+W2iw==
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:42265
| NNTP-Posting-Host: tk2msftngxa08.phx.gbl 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Certain Forms in the Application are using the Singleton
| Deisgn Pattern, whereby when the Form is invoked for the
| first time, it is kept persistent in memory, so next time
| I give a call for the Form, the same Form is shown and
| when I close the Form, it is just hidden. So the Form is
| active for the entire lifetime of the Application once
| invoked.
|
| This approach has been used for saving the load time of
| certain complex forms.
|
| The Constructor is declared private and a shared method is
| used to return its object. wherever this Form is required
| the shared GetInstance method is used and on the Form
| Close event, the Form is hidden.
|
| Here goes code :
|
| Usage : Dim ofrmNumericTB As frmNumericTextBox
| ofrmNumericTB = ofrmNumericTB.GetInstanceofNTB
|
|
| Public Class frmNumericTextBox
| Inherits System.Windows.Forms.Form
|
| Private Shared goNumericForm As frmNumericTextBox
| Private Sub New()
| MyBase.New()
| End Sub
| '..... other windows desisner code goes here
|
| Private Sub frmNumericTextBox_Closing(ByVal sender As
| Object, ByVal e As System.ComponentModel.CancelEventArgs)
| Handles MyBase.Closing
| Me.Hide
| End Sub
|
| Public Shared Function GetInstance() As
| frmNumericTextBox
| Try
| If goNumericForm Is Nothing Then
| goNumericForm = New
| frmNumericTextBox
| End If
| goNumericForm.Enabled = True
| goNumericForm.Show()
| GetInstance = goNumericForm
| Catch ex As Exception
| Throw New Exception("Form object cannot be
| created.")
| End Try
| End Function
| End Class
|
| *******************************************************
|
| >-----Original Message-----
| >Hi Edward,
| >
| >I'm not sure what you mean by 'singleton form'.
| When .ShowDialog is used,
| >we disable the topmost form (desired behavior for a modal
| dialog)...other
| >then that we don't automatically disable anything.
| >
| >If you can provide me a small code sample demonstrating
| the problem, I'd
| >like to look into any differences between SP2 and SP1.
| >
| >Thanks,
| >-Katie
| >
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
| >
| >***.Net Compact Framework Info***
| >Faq:
| >
http://msdn.microsoft.com/mobility/prodtechinfo/devtools/n
| etcf/FAQ/default.a
| >spx
| >QuickStarts:
|
http://samples.gotdotnet.com/quickstart/CompactFram
| ework/
| >Samples:
| >
http://msdn.microsoft.com/library/default.asp?
| url=/library/en-us/dnnetcomp/h
| >tml/CompactfxTechArt.asp
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "Edward Fernandes"
| <
[email protected]>
| >| Sender: "Edward Fernandes"
| <
[email protected]>
| >| Subject: Problem with .Net Compact Framework SP2
| >| Date: Wed, 24 Dec 2003 01:23:26 -0800
| >| Lines: 29
| >| Message-ID: <
[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| Thread-Index: AcPJ/5XSHXdoszJUTGuOGg36ut6bcA==
| >| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| >| Newsgroups:
| microsoft.public.dotnet.framework.compactframework
| >| Path: cpmsftngxa07.phx.gbl
| >| Xref: cpmsftngxa07.phx.gbl
| >microsoft.public.dotnet.framework.compactframework:41669
| >| NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
| >| X-Tomcat-NG:
| microsoft.public.dotnet.framework.compactframework
| >|
| >| Hi,
| >|
| >| We have developed an application for PocketPC
| using .Net
| >| Compact Framework.
| >| Recently we installed .Net Compact Framework SP2, and
| we
| >| have been facing some problems.
| >| In this application we have some Singleton Forms.
| >| when this Singleton Form is invoked thru some other
| Form,
| >| the Form gets disabled.
| >| ie. No events are received by this Singleton Form, none
| of
| >| the controls on it gets focus.
| >|
| >| We have found a workaround for it, just before calling
| the
| >| show method, we set the Enabled Property of the Form to
| >| true
| >| ie frmForm.Enabled=true
| >| frmForm.show()
| >|
| >| Just by setting the Enabled Property to true, the Form
| >| starts receving events, even though in Debug Window,
| the
| >| Enable property of that Form is still true.
| >| In earlier version of .Net CF, it used to work fine.
| >|
| >| Has anybody faced this problem before or could provide
| >| some inputs on it ?
| >|
| >| Thanx
| >| Edward Fernandes
| >|
| >|
| >
| >.
| >
|