Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Steve144

@Steve144
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to get list of worksheet names using VC++ [modified]
    S Steve144

    // --- 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 ); }

    C / C++ / MFC c++ tutorial learning

  • CListCtrl
    S Steve144

    Nave, The color is grey (225,225,225). I have changed to red, but no change is B/G color of image

    C / C++ / MFC graphics tutorial

  • CListCtrl
    S Steve144

    Oops - 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) );

    C / C++ / MFC graphics tutorial

  • CListCtrl
    S Steve144

    I 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.

    C / C++ / MFC graphics tutorial

  • CListCtrl
    S Steve144

    I 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

    C / C++ / MFC graphics tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups