我用的是embedded Visual C++ 4.0,和VC++6.0差不多。想在客户区放置几个图像按钮,可是一直搞不通,网上很多讲CBitmapButton的文章,可是都是放在对话框上的.而用在Doc/View结构的程序客户区内就行不通。eVC不支持CButton的SetBitmap方法,所以只能用CBitmapButton的LoadBitmaps.
MSDN里这麽说:
To create a bitmap-button control in a window’s client area 1.Create one to four bitmap images for the button. 
2.Construct the CBitmapButton object. 
3.Call the Create function to create the Windows button control and attach it to the CBitmapButton object. 
4.Call the LoadBitmaps method to load the bitmap resources after the bitmap button is constructed. CBitmapButton myButton;
--------------------------------------------------------------------
MSDN还给了一个例子
// Create the bitmap button (must include the BS_OWNERDRAW style).
myButton.Create(NULL, WS_CHILD|WS_VISIBLE|BS_OWNERDRAW, 
  CRect(10,10,100,100), pParentWnd, 1);// Load the bitmaps for this button.
myButton.LoadBitmaps(IDB_UP, IDB_DOWN, IDB_FOCUS, IDB_DISABLE);// Resize the button to be the size of the bitmaps.
myButton.SizeToContent();
讲得太简单了,都没说这些代码放在哪里?我把它们放在CmyView::PreCreateWindow()内,把pParentWnd替换为this,位图都画好放在资源里面,编译连接通过,可是一运行就出错。把最好一行去掉就不会出错,可是按钮依然没有显示出来。
还有,如果显示问题解决了,那么它的消息循环怎么设?响应事件怎么写?
谢谢各位大侠了。这个问题困扰小弟几天了,在线急等啊~