Close the form if the textbox hasn't validated RRS feed

  • Question

  • Hi,
    I am using Validating event to validate the textbox. All good and dandy. However, I would like the user to be able to close the form at any time.

    I was wondering if there is a way to do this since WndProc is not supported in NetCF? if someone could refer me to the clear instructions on how to achieve this under 2 hours of searching the web, that would be great!
    Monday, June 16, 2008 7:10 PM


All replies

  • Hi


    You can PInvoke the required functionality. Look at the following examples:






    Hope that helps




    Monday, June 16, 2008 7:21 PM
  • Thanks Daniel,

    from what I understand alternatively I can use
    IMessageFilter Interface

    as per

    Please clarify.
    Monday, June 16, 2008 8:08 PM
  • Hy

    Yes I think that would be the alternative. An example how to use the IMessageFilter you can find here:




    The smart device library implementation works according to the MSDN article...


    Hope that helps



    Monday, June 16, 2008 8:11 PM
  • I am using this example:


    and I get the following error:

    'OpenNETCF.Windows.Forms.IMessageFilter' is not implemented by this class.   

    Am I missing something?

    I tried to comment and ask the author of the code, but the blog's commenting feature doesn't work.

    these are my includes:

    Imports OpenNETCF.Windows.Forms
    Imports OpenNETCF.Win32.WM
    Imports System.Diagnostics

    Imports System.Windows.Forms
    Imports OpenNETCF.WindowsCE

    Monday, June 16, 2008 9:03 PM
  • oh, i got it to work

    remind me once why i don't use VB, was a trivial syntax error, lol
    Monday, June 16, 2008 9:31 PM
  • Hy Big Smile


    Glad I could help Big Smile



    Tuesday, June 17, 2008 5:00 AM