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

    Help! CBitmapButton Dynamically Create

    Hi,

    I am dynamically creating a bitmapbutton that loads a bitmap on a button.

    m_pcBtnAutoMode = new CBitmapButton();
    left = 637;
    width = 100;
    top = 248;
    height = 52;
    m_pcBtnAutoMode->CreateEx(WS_EX_CLIENTEDGE,csBUTTON_CONTROL,"Auto Mode",
    dwSTATUS_STYLE, left, top, width, height,
    GetSafeHwnd(), (HMENU) IDC_BUTTON_PROCEED);
    CBitmap bmAutoModeOff;
    bmAutoModeOff.LoadBitmap(IDB_AUTOMODEOFF);
    m_pcBtnAutoMode->SetBitmap(bmAutoModeOff);

    I looked at this problem for several hours. The button appears, but not the bitmap. Please help.

    Thanks,

    Rage

  2. #2
    Join Date
    Sep 2002
    Posts
    206

    never min

    Never mind, I found the answer. pretty simple.


    m_pcBtnAutoMode = new CBitmapButton();
    left = 637;
    width = 100;
    top = 248;
    height = 52;
    m_pcBtnAutoMode->CreateEx(WS_EX_CLIENTEDGE,csBUTTON_CONTROL,"Auto Mode",
    WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, left, top, width, height,
    GetSafeHwnd(), (HMENU) IDC_BUTTON_PROCEED);
    m_pcBtnAutoMode->LoadBitmaps(IDB_AUTOMODEOFF);

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