我有一個對話框和列表控件。
我添加使用insertitem
列表控制一個巨大的字符串。爲什麼在mfc的listcontrol中插入文本顯示截斷文本? listcontrol是可調整的?
m_WSDLParamList.InsertItem(LVIF_TEXT | LVIF_PARAM, i, str, 0, 0, 0, NULL);
// str is very huge.
現在,我回來使用
CString str = m_WSDLParamList.GetItemText(5,0);
(即無論我把我得到了它,因爲它是。)
字符串但是,在顯示我看到字符串截斷。這是爲什麼?
注意:我的對話框是可調整大小的,因此是
listcontrol
。
代碼 -
mylist.EnableToolTips(TRUE); mylist.SetExtendedStyle(LVS_EX_INFOTIP | mylist.GetExtendedStyle()); mylist.InsertColumn(0,L「suri」,LVCFMT_LEFT,100);
CString str1 = L"nonNegativeInteger GetVehicleOwnerHolderByRegNumAndDateResponse.GetVehicleOwnerHolderByRegNumAndDateResult[optional].GetVehicleOwnerHolderByRegNumAndDateResultType.VHOwnerHolderResponse.VHOwnerHolderResponseType.Body.VehicleCountries.VehicleCountriesType.VehicleCountry[1, unbound].VehicleCountryType.VehCountryReplies.VehCountryRepliesType.VehCountryReply[1, unbound].Messages[optional].Message[1, unbound].MessageType.MessageCode";
for (int i = 0; i < 20 ; i++) {
mylist.InsertItem(LVIF_TEXT | LVIF_PARAM, i, str1, 0, 0, 0, NULL);
}
請表明,定義了的CListCtrl的報頭控制的列中的代碼。 – rrirower 2015-04-02 13:09:11
有些圖片會有所幫助。 – 2015-04-02 13:40:26
因爲我想更多的信息,我嘗試猜測: 您在報告模式列表控制。您插入了一個寬度有限的列。因此,所有項目都被截斷爲列表控件中列的寬度。 – xMRi 2015-04-02 14:06:10