全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:933
推到 Plurk!
推到 Facebook!

combobox 的 height

尚未結案
wsxcv123
一般會員


發表:36
回覆:27
積分:12
註冊:2004-11-10

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-12-14 17:43:37 IP:61.222.xxx.xxx 未訂閱
請問要如何改 combobox 的 height 阿? 我改了height 的數字可是沒什ㄇ變
GGL
資深會員


發表:104
回覆:600
積分:335
註冊:2006-11-05

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-12-14 18:45:31 IP:211.76.xxx.xxx 未訂閱
他的Height是隨著字型的大小改變的,似乎沒辦法改(應該是說我不知道怎麼改)
Zard
尊榮會員


發表:24
回覆:396
積分:539
註冊:2003-11-26

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-12-23 09:15:36 IP:210.243.xxx.xxx 未訂閱
引言: 請問要如何改 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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-12-23 09:36:57 IP:210.243.xxx.xxx 未訂閱
引言:
引言: 請問要如何改 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

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-12-23 11:41:24 IP:61.222.xxx.xxx 未訂閱
太棒了 我是要讓
系統時間:2024-04-28 3:28:40
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!