CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2007
    Posts
    25

    Question Images are not visible on tab control

    I have written following code,I am able to see tabs but with only text not images
    IDB_BITMAP is image of size 96*32;

    CImageList ci;
    ci.Create(IDB_BITMAP1,32,1,RGB(255,0,0));
    m_tab.SetImageList(&ci);
    m_tab.InsertItem(1,_T("one"),0);
    m_tab.InsertItem(2,_T("two"),1);
    m_tab.InsertItem(3,_T("three"),2);

    Please help on this issue.
    One More Question ,how I can use this tabbed pages,Can I place other controls like button listbox etc on tab,if yes how ?
    Last edited by shivditya; March 18th, 2012 at 01:54 AM.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Images are not visible on tab control

    Quote Originally Posted by shivditya View Post
    I have written following code,I am able to see tabs but with only text not images
    IDB_BITMAP is image of size 96*32;

    Code:
    CImageList ci;
    ci.Create(IDB_BITMAP1,32,1,RGB(255,0,0));
    What dose the Create() return?

    Quote Originally Posted by shivditya View Post
    Code:
    ...
    m_tab.InsertItem(1,_T("one"),0);
    m_tab.InsertItem(2,_T("two"),1);
    m_tab.InsertItem(3,_T("three"),2);
    And what about the tab with index zero?

    Quote Originally Posted by shivditya View Post
    how I can use this tabbed pages,Can I place other controls like button listbox etc on tab,if yes how ?
    You usually place "other controls like button listbox etc" on the dialog, not on the tab itself and then you show a dialog corresponding the tab that user selects...
    Another way is to use CPropertySheet with CPropertyPage objects.

    Please, read MSDN about using them.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured