请问大家能做一个TComboBox [StdCtrls] 继承的控件吗,我做好后出现了rtl60.bpl错误,我是用BCB6+WIN2000,大家中秋快乐
你能不能试下用以下这个类做个控件,让后加入OnMouseMove,OnMouseUp,OnMouseDown 事件,我试了N次不成功,老是rtl60.bpl错误,放不到窗口上去。谢谢,如果成功请告诉我啊。
TComboBox [StdCtrls]
我的做法如下:在.h文件里加入三行鼠标消息的公布。
class PACKAGE TComboBox1 : public TComboBox
{
private:
protected:
public:
__fastcall TComboBox1(TComponent* Owner);
__published:
__property OnMouseMove;
__property OnMouseDown;
__property OnMouseUp;
};
//.cpp文件
#include <vcl.h>
#pragma hdrstop
#include "ComboBox1.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TComboBox1 *)
{
new TComboBox1(NULL);
}
//---------------------------------------------------------------------------
__fastcall TComboBox1::TComboBox1(TComponent* Owner)
: TComboBox(Owner)
{
}
//---------------------------------------------------------------------------
namespace Combobox1
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TComboBox1)};
RegisterComponents("Data Controls", classes, 0);
}
}