TComboBox的高度改变问题

DblSun 2005-03-11 03:19:39
new 一个TComboBox控件,如果Parent设为Form,则可以修改其高度,通过修改TComboBox的Height或者ItemHeight,但是如果Parent设为其他控件,比如TPanel或者TListView等,则其高度不能改变,为何会有这种现象?有何办法可以改变吗?谢谢!
...全文
133 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
DblSun 2005-03-11
  • 打赏
  • 举报
回复
刚发现可以这么做
TComboBox *pCbx = new TComboBox(this);
pCbx->Style = csOwnerDrawFixed;
pCbx->ItemHeight = Edit1->Text.ToInt();
pCbx->Top =10;
pCbx->Left = 20;
pCbx->Visible = true;
pCbx->Parent = Panel1;
DblSun 2005-03-11
  • 打赏
  • 举报
回复
刚发现可以这么做
TComboBox *pCbx = new TComboBox(this);
pCbx->Style = csOwnerDrawFixed;
pCbx->ItemHeight = Edit1->Text.ToInt();
pCbx->Top =10;
pCbx->Left = 20;
pCbx->Visible = true;
pCbx->Parent = Panel1;
DblSun 2005-03-11
  • 打赏
  • 举报
回复
刚发现可以这么做
TComboBox *pCbx = new TComboBox(this);
pCbx->Style = csOwnerDrawFixed;
pCbx->ItemHeight = Edit1->Text.ToInt();
pCbx->Top =10;
pCbx->Left = 20;
pCbx->Visible = true;
pCbx->Parent = Panel1;
HYCabc 2005-03-11
  • 打赏
  • 举报
回复
up
constantine 2005-03-11
  • 打赏
  • 举报
回复
不行吧,
TComboBox的height好像不能改变的,
Sephil 2005-03-11
  • 打赏
  • 举报
回复
只有Style为OwnerDraw的时候才可以改变大小

602

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder VCL组件使用和开发
社区管理员
  • VCL组件使用和开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧