// --- Print worksheet names Excel::_WorksheetPtr p_sheet; m_lngWorksheets = m_xLBook->Worksheets->Count; TRACE("Number of Worksheets is <%d>\n", m_lngWorksheets ); for ( ico=1;ico<=m_lngWorksheets;ico++ ) { p_sheet = m_xLBook->Worksheets->Item[ico]; _stprintf(p_szBuffer, _T("%s"), (LPCTSTR)p_sheet->Name); TRACE("Worksheet %d Name is %s\n", ico, p_szBuffer ); }
Steve144
Posts
-
How to get list of worksheet names using VC++ [modified] -
CListCtrlNave, The color is grey (225,225,225). I have changed to red, but no change is B/G color of image
-
CListCtrlOops - not a good bit of code ... I have inserted the following code in the OnCustomDraw() function, and there is no change in B/G color of the listview image CImageList *imgS = (CImageList *) CListCtrlEx::GetImageList ( LVSIL_SMALL ); ASSERT ( imgS != NULL ); CImageList *imgN = (CImageList *) CListCtrlEx::GetImageList ( LVSIL_NORMAL ); ASSERT ( imgN != NULL ); ..... case CDDS_SUBITEM | CDDS_PREPAINT | CDDS_ITEM: { imgS->SetBkColor ( RGB(225, 225, 225) ); imgN->SetBkColor ( RGB(225, 225, 225) );
-
CListCtrlI tried setting the background color in the OnInitDialog() function. No change ... Next I tried CImageList *img = (CImageList *) CListCtrlEx::GetDlgItem (IDB_IMAGES_SMALL); ASSERT ( img != NULL ); but the return value of img is NULL.
-
CListCtrlI have used the CListCtrl example 'LVCustomDraw' to create a list control with colored columns. This works fine until I add an imagelist (BITMAP) to the list control. My class is derived from the CListCtrl class, and I use two functions 'OnEraseBkgnd' and 'OnCustomDraw' to color the alternate columns. The list control and imagelist are defined in the dialog class header ... CListCtrlEx m_ctlList; CImageList m_cImageListNormal, m_cImageListSmall, m_cImageListState; ... and the bitmap is add in the dialog class ... // Create 256 color image lists HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 |ILC_MASK , 8, 1); m_cImageListNormal.Attach(hList); hList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 8, 1); m_cImageListSmall.Attach(hList); // Load the large icons CBitmap cBmp; cBmp.LoadBitmap(IDB_IMAGES_NORMAL); m_cImageListNormal.Add(&cBmp, RGB(255, 0, 255)); //m_colRow1 cBmp.DeleteObject(); // Load the small icons cBmp.LoadBitmap(IDB_IMAGES_SMALL); m_cImageListSmall.Add(&cBmp, RGB(255,0,255)); // Attach them m_ctlList.SetImageList(&m_cImageListNormal, LVSIL_NORMAL); m_ctlList.SetImageList(&m_cImageListSmall, LVSIL_SMALL); ... The columns and items are then added. I assume the default color of the list control is white, and the image is transparent, but when the background is redrawn, the image is not being 'refreshed', and hence it appears to have a white background. I have noticed another example on CodeProject that has a similar result when the image is added. Thank you Steve