CComboBox::GetLBTextLenは、コンボボックスのリストボックス領域で選択されている項目のテキストの長さを取得するメンバ関数・・・。
CListBoxはGetTextLenだったが、CComboBoxはGetLBTextLenで長さを取得・・・。
追加ボタンButton1に加えて、選択された項目のテキストの長さを表示するButton2を用意・・・。
pComboBox1->GetCurSelでインデックスを取得・・・。
そのインデックスを使って、pComboBox1->GetLBTextLenで選択項目のテキストの長さを取得・・・。
_stprintfで長さを文字列に変換して、AfxMessageBoxで表示・・・。
"あいうえお"でButton2を押す・・・。
長さ5・・・。
"123"でButton2を押す・・・。
長さ3・・・。
"ABC"でButton2を押す・・・。
長さ3・・・。
Sample/CComboBox.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBox.cpp at master · bg1bgst333/Sample · GitHub
Sample/CComboBoxDlg.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBoxDlg.cpp at master · bg1bgst333/Sample · GitHub
Sample/resource.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBox.rc at master · bg1bgst333/Sample · GitHub
Sample/stdafx.h at master · bg1bgst333/Sample · GitHub
Sample/stdafx.cpp at master · bg1bgst333/Sample · GitHub