LoginSignup
0
1

More than 5 years have passed since last update.

DDX

Posted at

DDXの練習その1

ボタンを押したらテキストボックスに現在時刻が表示されるものを書いてみる

01.png

  • 右クリック⇒変数の追加

    02.png

  • 「カテゴリ」を「Value」に、
    「変数の種類」を「CString」に、
    「変数名」を適当に入力 ⇒「m_xv」で始まるのが慣習っぽい?

    03.png

  • ボタンクリックイベントにコードを書く
    最後のUpdateData(FALSE);で、コードからコントロールに反映されるので忘れないように!

void CTest01Dlg::OnBnClickedButton1()
{
    CTime time = CTime::GetCurrentTime();
    CString str = time.Format("%Y/%m/%d %H:%M:%S");

    this->m_xvEdit01 = str;

    UpdateData(FALSE);
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1