@Castorix31 , I am obliged for his work on my question.The bitmaps that are used should all be of same size I think otherwise the output is getting mixed up. This is the working code for achieving the changed buttons.However the change of images is no so smooth.
void ChangeImageList(int sel)
{
for (int i = 0; i < 3; i++)
{
m_bmpimgs[i].~CBitmap();
}
if (sel == 0)
retval=m_bmpimgs[0].LoadBitmapA(IDB_BITMAP87);
else
retval=m_bmpimgs[0].LoadBitmapA(IDB_BITMAP77);
if (sel == 1)
retval=m_bmpimgs[1].LoadBitmapA(IDB_BITMAP86);
else
retval=m_bmpimgs[1].LoadBitmapA(IDB_BITMAP81);
if (sel == 2)
retval=m_bmpimgs[2].LoadBitmapA(IDB_BITMAP88);
else
retval=m_bmpimgs[2].LoadBitmapA(IDB_BITMAP79);
m_wndPane1.RemoveAllButtons();
//This line not to be used
//m_wndPane1.ClearAll();
retval=m_wndPane1.AddButton(m_bmpimgs[0], "Button one text", 10050, 0);
retval=m_wndPane1.AddButton(m_bmpimgs[1], "Button Two Text", 10051, 1);
retval=m_wndPane1.AddButton(m_bmpimgs[2], "Button three text", 10052, 2);
m_wndPane1.InvalidateButton(0);
m_wndPane1.InvalidateButton(1);
m_wndPane1.InvalidateButton(2);
}