wsxcv123
一般會員
發表:36 回覆:27 積分:12 註冊:2004-11-10
發送簡訊給我
|
請問要如何改 combobox 的 height 阿?
我改了height 的數字可是沒什ㄇ變
|
GGL
資深會員
發表:104 回覆:600 積分:335 註冊:2006-11-05
發送簡訊給我
|
他的Height是隨著字型的大小改變的,似乎沒辦法改(應該是說我不知道怎麼改)
|
Zard
尊榮會員
發表:24 回覆:396 積分:539 註冊:2003-11-26
發送簡訊給我
|
引言:
請問要如何改 combobox 的 height 阿?
我改了height 的數字可是沒什ㄇ變
提供您另一種改變高度的做法
//--------------------------------------------------------------------------- #include
#pragma hdrstop #include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// 設定Style屬性為lbOwnerDrawVariable
ComboBox1->Style = csOwnerDrawVariable;
}
//---------------------------------------------------------------------------
// 實作CheckList的 OnMeasureItem 事件
void __fastcall TForm1::ComboBox1MeasureItem(TWinControl *Control,
int Index, int &Height)
{
// 設定Item的高度
Height = 30;
}
//---------------------------------------------------------------------------
|
Zard
尊榮會員
發表:24 回覆:396 積分:539 註冊:2003-11-26
發送簡訊給我
|
引言:
引言:
請問要如何改 combobox 的 height 阿?
我改了height 的數字可是沒什ㄇ變
提供您另一種改變高度的做法
//--------------------------------------------------------------------------- #include
#pragma hdrstop #include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// 設定Style屬性為lbOwnerDrawVariable
ComboBox1->Style = csOwnerDrawVariable;
}
//---------------------------------------------------------------------------
// 實作CheckList的 OnMeasureItem 事件
void __fastcall TForm1::ComboBox1MeasureItem(TWinControl *Control,
int Index, int &Height)
{
// 設定Item的高度
Height = 30;
}
//---------------------------------------------------------------------------
抱歉修正一下, 這樣做就可以了
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
// 設定Style屬性為lbOwnerDrawVariable
ComboBox1->Style = csOwnerDrawVariable;
// 設定Item的高度
ComboBox1->ItemHeight = 30;
}
|
wsxcv123
一般會員
發表:36 回覆:27 積分:12 註冊:2004-11-10
發送簡訊給我
|
太棒了
我是要讓
|