學(xué)習(xí)C# MessageBox用法的一點(diǎn)體會(huì)
關(guān)于C# MessageBox用法的問(wèn)題是我們?cè)诰幊踢^(guò)程中比較困擾我們的,那么如何解決這些相關(guān)的C# MessageBox用法中的修改問(wèn)題呢?下面為你提供了一些小的思路。
對(duì)于C# MessageBox用法的問(wèn)題有的細(xì)節(jié)可以參考以下兩篇文章 ,完成了在中文系統(tǒng)上顯示英文的對(duì)話框。希望能夠解決你所遇到的相同的問(wèn)題,算是一個(gè)思路的共享吧。
C# MessageBox用法相關(guān)文章:
主要使用技術(shù),關(guān)鍵詞包括:C#中使用鉤子函數(shù)。
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用法實(shí)例:構(gòu)造函數(shù)
- public MessageBoxInternal()
- {
- //
- // TODO: Add constructor logic here
- //
- m_cbt = new LocalCbtHook();
- m_cbt.WindowCreated +=
- newLocalCbtHook.CbtEventHandler(WndCreated);
- m_cbt.WindowDestroyed +=
- new LocalCbtHook.CbtEventHandler(WndDestroyed);
- m_cbt.WindowActivated +=
- new LocalCbtHook.CbtEventHandler(WndActivated);
- }
- private void WndCreated(object sender, CbtEventArgs e)
- {
- if (e.IsDialogWindow)
- {
- m_bInit = false;
- m_hwnd = e.Handle;
- }
- }
- private void WndDestroyed(object sender, CbtEventArgs e)
- {
- if (e.Handle == m_hwnd)
- {
- m_bInit = false;
- m_hwnd = IntPtr.Zero;
- //if(BST_CHECKED == (int)SendMessage(
- //m_hwndBtn,BM_GETCHECK,IntPtr.Zero,IntPtr.Zero))
- // m_bCheck = true;
- }
- }
- private void WndActivated(object sender, CbtEventArgs e)
- ...
C# MessageBox用法的一點(diǎn)體會(huì)就向你介紹到這里,希望對(duì)你了解和學(xué)習(xí)C# MessageBox用法有所幫助。
【編輯推薦】