我正在嘗試為我的程式構建一個暗模式,現在我再次遇到了來自 TMS 的 PlannerMonthView 的問題。您可以更改接近月份計劃器的任何顏色,但不能更改專案顏色。有誰知道如何將其更改為不同的顏色,如灰色或類似的顏色?
uj5u.com熱心網友回復:
然后將 TPlannerMonthViewItems[n].color 設定為所需的顏色
with PlannerMonthView.CreateItem do
begin
id := 1;
Color := clGray;
CaptionBkg := Color;
shadow := true;
Text.Text := 'Test1';
ItemStartTime := StrToDate('21/09/2021');
ItemEndTime := StrToDate('21/09/2021');
end;
uj5u.com熱心網友回復:
來自 TMS 的 TPlanner 手冊 ** 控制網格中 TPlannerItem 外觀的其他屬性是:
Alignment : 設定 TPlannerItem 中文本的對齊方式
Attachement:字串可以指向一個附件。如果 Attachement 是非空字串,則這由 TPlannerItem 標題中的剪輯指示
背景:當為真時,專案顯示時沒有可選擇的邊框,并且不能移動或調整大小。
BorderColor : 設定 TPlannerItem 的邊框顏色
BrushStyle : 設定TPlannerItem的背景畫筆樣式
CaptionAlign : 設定 TPlannerItem 標題文本的對齊方式
CaptionBkg : 設定 TPlannerItem 標題的背景顏色。當 UniformBkg 為 true 時,此屬性無效,因為 TPlannerItem 將始終具有完全統一的顏色
CaptionBkgTo:當與 clNone 不同且 UniformBkg 為 false 時,使用從 CaptionBkg 顏色到 CaptionBkgTo 顏色的漸變繪制標題
CaptionBkgDirection : 設定字幕背景漸變方向
CaptionFont : 設定 TPlannerItem 標題的字體
CaptionText : 設定標題的文本。此文本僅在 CaptinTupe 為 ctText 或 ctTimeText 時顯示
CaptionType : 可以
- ctNone : 不顯示標題
- ctText : CaptionText 顯示
- ctTime : 顯示專案的時間
- ctTimeText : 時間和 CaptionText 同時顯示
Color : 設定 TPlannerItem 的背景顏色
ColorTo : 設定TPlannerItem背景的漸變結束顏色。當設定為 clNone 時,背景以純色繪制。
ColorDirection : 設定專案背景漸變方向
完成:設定專案的完成。這是一個介于 0 和 100 之間的值。
CompletionDisplay : 設定顯示完成的位置。該值可以是:cdNone、cdVertical、cdHorizo??ntal。
Cursor:設定滑鼠懸停在專案上時使用的游標。如果 Cursor 為 -1,則使用默認游標。
DrawTool:這會分配一個組件,該組件封裝了 TPlannerItem 的自定義繪圖。如果指定了 drawtool 組件,則該組件將在規劃器中繪制該專案。
Editor:設定將用于編輯專案的編輯器組件的實體。
EditMask:設定當就地編輯器型別為 peEditMask 時將使用的編輯掩碼。
Font : 設定TPlannerItem的字體
HintIndicator : 當為 true 時,專案右上角會顯示一個小三角形,表示該專案有提示可用。當 HintIndicator 僅在 Hint 屬性也是非空字串時才顯示。
HintIndicatorColor : 設定指示專案存在提示的小三角形的顏色。
ImageID : 從附加的影像串列中設定影像的索引以顯示在 TPlannerItem 中
ImagePosition:設定要顯示的關聯影像的位置。
InHeader : 當為 true 時,該專案顯示在 TPlanner 標題內
SelectColor : 設定專案被選中時的顏色
SelectColorTo : 設定專案被選中時的漸變結束顏色
SelectFontColor: sets the font color of the item when it is selected
Shadow: when true, the TPlannerItem is displayed with a shadow. The shadow color is set with the property TPlanner.ShadowColor
Shape: sets the shape of the TPlannerItem to rectangle, hexagon, rounded rectangle or skinned. When skinned, the Planner Skin is used to draw the item.
ShowDeleteButton: when true, a delete button is displayed in the upper right corner of the planner item.
ShowLinks: when true, a chain icon is displayed to show the item is linked to another TPlannerItem
ShowSelection: when true, selected items are displayed with SelectColor and SelectFontColor
Text: the stringlist through which the TPlannerItem text is set
TrackBrushStyle: sets the brush to be used for painting the trackbar of the item
TrackColor: sets the color of the trackbar. The trackbar is the small colored bar with which the item can be dragged and moved inside the planner grid.
TrackSelectColor: sets the color of the trackbar when the item is selected
TrackLinkColor: sets the color of the trackbar when a linked item is selected.
TrackVisible: when true, the trackbar is visible on the TPlannerItem Unicode: when true, a Unicode caption and text is displayed for the TPlannerItem. The Unicode caption and text is set with WideCaption and WideText properties. Only used in non-Unicode Delphi versions!
UniformBkg: when true, CaptionBkg color has no effect
URL: string that can point to an URL. If URL is a non-empty string a link icon is displayed in the TPlannerItem caption
Visible: sets the visibility state of the TPlannerItem
WideCaption: sets the caption as Unicode (widestring) text. Set Unicode = true in order to see the Unicode text in the caption. Only used in non-Unicode Delphi versions!
WideText: sets the TPlannerItem text as Unicode. Only used in non-Unicode Delphi versions!
WordWrap: when true, TPlannerItem text is displayed with wordwrapping.
link to manual : https://download.tmssoftware.com/Download/Manuals/TMS TPLANNER.pdf
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/315623.html
