Forum > Arabic

كيفية التحكم في مكون main menu ؟

(1/1)

Gebo:
كيف استطيع تغير حجم الخط للقوائم وتغيير لونها؟
وإذا لم يكن هناك إمكانية التحكم في الشكل واللون وحجم الخط فهل هناك مكون بديل يمنح تلك الإمكانيات؟

nouzi:
جرب هذا
https://www.askingbox.com/question/delphi-lazarus-how-can-i-change-font-and-color-of-menu-or-popupmenu

المكون البديل spktoolbar

https://sourceforge.net/projects/lazarus-ccr/files

Al-Eid:

--- Quote from: nouzi on April 15, 2024, 10:24:26 am ---جرب هذا
https://www.askingbox.com/question/delphi-lazarus-how-can-i-change-font-and-color-of-menu-or-popupmenu


--- End quote ---


لقد جربته أنه يعمل مع PopupMenu1 و MainMenu1
يوضع هذا الكود في حدث FormShow(Sender: TObject);

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- PopupMenu1.OwnerDraw := true;
ويوضع هذا الكود في حدث PopupMenu1MeasureItem Sender: TObject; ACanvas: TCanvas;
  ARect: TRect; AState: TOwnerDrawState);

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var    s: string;  begin    // change font    ACanvas.Font.Name := 'Consolas';    ACanvas.Font.Size := 14;    ACanvas.Font.Style := [fsBold];    ACanvas.Font.Color := clYellow;    // change background    ACanvas.Brush.Color := clBlack;    ACanvas.Rectangle(ARect);    // write caption/text    s := (Sender as TMenuItem).Caption;    ACanvas.TextOut(ARect.Left + 2, ARect.Top + 2 , s);  end; 
يمكن وضع الكود السابق في كل عنصر لوحده لللقائمة ليكون كل عنصر لون وشكل معين




Gebo:
شكرا جزيلا

Navigation

[0] Message Index

Go to full version