学习C# MessageBox用法的一点体会

关于C# MessageBox用法的问题是我们在编程过程中比较困扰我们的,那么如何解决这些相关的C# MessageBox用法中的修改问题呢?下面为你提供了一些小的思路。

对于C# MessageBox用法的问题有的细节可以参考以下两篇文章 ,完成了在中文系统上显示英文的对话框。希望能够解决你所遇到的相同的问题,算是一个思路的共享吧。

C# MessageBox用法相关文章:

主要使用技术,关键词包括:C#中使用钩子函数。

http://www.codeproject.com/cpp/dMsgBox.asp

How to change the MessageBox window

http://www.codeproject.com/cs/miscctrl/MessageBoxChk.asp

A "Don't show this again" checkbox for the .NET MessageBox

C# MessageBox用法实例:构造函数

 
 
 
  1. public MessageBoxInternal()  
  2. {  
  3.  //  
  4.  // TODO: Add constructor logic here  
  5.  //  
  6.  m_cbt = new LocalCbtHook();  
  7.  m_cbt.WindowCreated +=   
  8. newLocalCbtHook.CbtEventHandler(WndCreated);  
  9.  m_cbt.WindowDestroyed +=   
  10. new LocalCbtHook.CbtEventHandler(WndDestroyed);  
  11.  m_cbt.WindowActivated +=   
  12. new LocalCbtHook.CbtEventHandler(WndActivated);   
  13. }  
  14.  
  15.  private void WndCreated(object sender, CbtEventArgs e)  
  16. {  
  17.    
  18.  if (e.IsDialogWindow)  
  19.  {  
  20. m_bInit = false;  
  21. m_hwnd = e.Handle;  
  22.  }  
  23. }  
  24.  
  25. private void WndDestroyed(object sender, CbtEventArgs e)  
  26. {  
  27.  if (e.Handle == m_hwnd)  
  28.  {  
  29. m_bInit = false;  
  30. m_hwnd = IntPtr.Zero;  
  31. //if(BST_CHECKED == (int)SendMessage(  
  32. //m_hwndBtn,BM_GETCHECK,IntPtr.Zero,IntPtr.Zero))  
  33. // m_bCheck = true;  
  34.  }  
  35. }  
  36.  
  37. private void WndActivated(object sender, CbtEventArgs e)  
  38. ...  

C# MessageBox用法的一点体会就向你介绍到这里,希望对你了解和学习C# MessageBox用法有所帮助。

 

【编辑推荐】

  1. C# CheckBox控件概念以及用途浅析
  2. 解析C# Socket编程实现访问网络的原理
  3. 浅析C# HTTP Request请求程序模拟
  4. 详解C# MessageBox用法
  5. 详解C# CheckBox选中的判断方法
THE END