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

    To Display Bitmap & Icon in a single picture ctrl

    Hi All,
    How can we display a bitmap & icon in a single picture
    control at different time.

    We can display a bitmap in a picture ctrl by setting its "type"
    property to BITMAP. Similarly Icon can also be displayed.

    But can we change this "type" property at run time.
    i.e. from Icon to Bitmap & vice versa.

    I called the ModifyStyleEx(). Eventhough this functionis returning success, Bitmaps and Icons ae not getting inerchanged.

    Thanks in Advance
    Cherian

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    224
    does it show after you hide the window and focus it again?

    if so you might have to invalidate your window and therefor force a repaint.

    Just try moving your window out of the screen and back and see if the change is then visible.
    CU

    Ingo

  3. #3
    Join Date
    May 2002
    Posts
    19
    OnButton1() click , i would call to display Bitmap
    and on OnButton2() click i would call to display Icon


    Button1()
    -------------
    m_Picture.ModifyStyleEx( SS_ICON,SS_BITMAP, 0);
    m_Picture.SetBitmap( ::LoadBitmap( AfxGetInstanceHandle() , MAKEINTRESOURCE(IDB_BITMAP1) ) );


    Button2()
    ------------
    m_Picture.ModifyStyleEx(SS_BITMAP ,SS_ICON, 0);
    m_Picture.SetIcon( ::LoadIcon( AfxGetInstanceHandle() , MAKEINTRESOURCE(IDI_ICON1) ) );

    Thanks
    Cherian

  4. #4
    Join Date
    Jun 2002
    Location
    Kuala Lumpur, Malaysia
    Posts
    36
    hi there, how do i load bmp or icon files onto the button on the runtime. i need to specify different bmp files on runtime, but how do i specify (commands) to load straight from file.
    TQ

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