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

請問如何幫自訂的VCL改圖示?

答題得分者是:RedSnow
jim1247
一般會員


發表:8
回覆:20
積分:5
註冊:2003-01-30

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-11-17 11:24:07 IP:59.120.xxx.xxx 未訂閱
想自己寫一個Comm的Component,繼承自TComponent 但不知如何修改圖示,好讓使用者一看就知此元件功用 謝謝
huwk
資深會員


發表:26
回覆:340
積分:323
註冊:2002-04-03

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-11-17 11:52:48 IP:61.222.xxx.xxx 未訂閱
善用SEARCH即有. VCL 圖示 http://delphi.ktop.com.tw/topic.php?TOPIC_ID=29739
------
熊的學習 http://huwk.blogspot.com
RedSnow
版主


發表:79
回覆:1322
積分:845
註冊:2003-12-15

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-11-17 12:36:57 IP:59.115.xxx.xxx 未訂閱
jim1247 您好:    以下是 BCB6 Help 中對建立元件圖示的步驟與說明,參考一下吧: Creating a bitmap for a component When you create a new component, you can define your own bitmaps for custom components.
  1. Choose Tools|Image Editor.
  2. In the Image Editor dialog box, choose File|New|Component Resource File (.dcr).
  3. In the untitled1.dcr dialog box, right-click Contents. Choose New|Bitmap.
  4. In the Bitmaps Properties dialog box, change both the Width and Height to 24 pixels. Make sure VGA (16 colors) is checked. Click OK.
  5. Bitmap and Bitmap1 appear below Contents. Select Bitmap1, right-click, and choose Rename. Give the bitmap the same name as the class name for your new component, including the T, using all uppercase letters. For example, if your new class name is going to be TMyNewButton, name the bitmap TMYNEWBUTTON. Note: You must name all uppercase letters, no matter how you spell the class name in the New Component dialog box.
  6. Double-click TMYNEWBUTTON to display a dialog box with an empty bitmap.
  7. Use the color palette at the bottom of the Image Editor to design your icon.
  8. Choose File|Save As and give the resource file (.dcr or .res) the same base name as the unit you want the component class declared in. For example, name the resource file MyNewButton.dcr.
  9. Choose Component|New Component. Follow the instructions for creating a new component using the Component wizard. Make sure that the component source, MyNewButton.cpp, is in the same directory as MyNewButton.dcr. The Component wizard, for a class named TMyNewButton, names the component source, or unit, MyNewButton.cpp with a default placement in the LIB directory. Click the Browse button to find the new location for the generated component unit. Note: If you are using a .res file for the bitmap rather than a .dcr file, then add a reference to the component source to bind the resource. For example, if your .res file is named MyNewButton.res, after ensuring that the .cpp and .res are in the same directory, add the following in MyNewButton.cpp: #pragma resource "*.res"
  10. Choose Component|Install Component to install your component into a new or existing package. Click OK.
Your new package is built and then installed. The bitmap representing your new component appears on the Component palette page you designated in the Component wizard.
7 天天敲鍵盤 v 時時按滑鼠 8
jim1247
一般會員


發表:8
回覆:20
積分:5
註冊:2003-01-30

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-11-17 13:00:51 IP:59.120.xxx.xxx 未訂閱
感謝! 其實我有用search找過... 大概是我key word打不好吧,找不到
系統時間:2024-11-23 7:34:20
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!