我用listctrl創建了一個幾行幾列的表格,然后添加兩個editctrl 和一個button ,我想在edit中分別輸入兩個數字 ,點擊button后 ,這兩個數分別簡單運算一下,比如乘以2乘以3之后分別顯示在串列中的某一行某一列,這個可以實作嗎
哪位大神能指點一下
uj5u.com熱心網友回復:
1. 自定義個CPropertyList類繼承自CListBoxclass CPropertyList : public CListBox //這個類中要有1個CEdit m_editBox
2.在上一步的CPropertyList中向串列添加可編輯的行
int nIndex = AddString(_T(""));
SetItemDataPtr(nIndex,pItem);//pItem是你自定義的可以表示list中的一行的資料結構3.添加CPropertyList對LBN_SELCHANGE訊息的回應
//在回應函式中創建編輯框
m_editBox.Create(...);
//設定顯示文本
m_editBox.ShowWindow(SW_SHOW);
m_editBox.SetFocus();
m_editBox.SetWindowText();
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/88741.html
標籤:模式及實現
上一篇:哪里錯了啊。咋改啊
