Question

Some dialogs like wizards should contain neither OK nor X button. How can I the OK or X button in the dialog in .Net Compact Framework application?

Answer

A. We have to import three functions from aygshell coredll DLLs:

 
[转载]How to hide the OK button in the dialog in .Net Compact Framework application?class WinAPI
 

B. Then we write 2 functions (HideDoneButton and HideXButton) and add several constants:

 
[转载]How to hide the OK button in the dialog in .Net Compact Framework application?class WinAPI
 

C. To hide the done (OK) button in the dialog you should add Paint event handler to the dialog and call HideDoneButton and HideXButton functions from there:

 
[转载]How to hide the OK button in the dialog in .Net Compact Framework application?public class MyForm : System.Windows.Forms.Form
 

If the Paint handler is not called then you should call there functions yourself from somewhere between the dialog creation and its destruction - one of the ideas is to create a timer and to call the functions from its handler.

Done!


原文地址

相关文章: