掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
キーイベントでEDITボックスの書き換えを行うには? (ID:62630)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
正直自動生成されるソースまで貼り付けられても、インデントすらされていないので読む気が起きません。 BOOL CEditTestDlg::PreTranslateMessage(MSG* pMsg) { // TODO: この位置に固有の処理を追加するか、または基本クラスを呼び出してください if ( pMsg->message == WM_KEYDOWN ) { if ( pMsg->wParam == VK_DOWN ) { CWnd* pWnd = CWnd::FromHandle( pMsg->hwnd ); CString text; pWnd->GetWindowText( text ); switch ( pWnd->GetDlgCtrlID() ) { case IDC_EDIT8: if ( text == _T( "1" ) ) { pWnd->SetWindowText( _T( "4" ) ); } else if ( text == _T( "4" ) ) { pWnd->SetWindowText( _T( "1" ) ); } break; case IDC_EDIT13: if ( text == _T( "2" ) ) { pWnd->SetWindowText( _T( "5" ) ); } else if ( text == _T( "5" ) ) { pWnd->SetWindowText( _T( "2" ) ); } break; case IDC_EDIT14: if ( text == _T( "3" ) ) { pWnd->SetWindowText( _T( "6" ) ); } else if ( text == _T( "6" ) ) { pWnd->SetWindowText( _T( "3" ) ); } break; } } } return CDialog::PreTranslateMessage(pMsg); }
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.