2010年1月16日 星期六

[VB .NET] How to Cancel the Closing of Form

[English Ver.]
     There is a X button on top-right side of form. When user press it, will raise an closing event. Before VB .NET 2008, we can set e.cancel=true in closing event function to stop the closing process. But there's no such event function in VB .NET 2008. There is another methond to use the function. We have to refer to system.windows.presentation in References page ,and the OnClosing(byval e as system.componentmodel.canceleventargs) event function will be gernerated.  But the closing function doesn't have content. OnClosing function should be "overrides" to stop closing by setting e.cancel=true.
  
    About the development of ASSEditor, v0.6 has already done. And which remains a testing version. Main changes are to suport Janpanese and Korean ANSI encoding. Encoding-convert is a very import ability to this program. So, the user will get garbage as soon as the impropriate encoding is choosen. That is why I choose Unicode as default encoding, unless user try to change the encoding. The fewer number of ANSI file is, the less miss-coding will make.

0 意見: