Delphi Dünyası Facebook'ta

Kodbank İndir

! CODEBANK 2012 !

İNDİRMEK&DETAYLI BİLGİ ALMAK İÇİN BURAYI TIKLAYINIZ.

Gönderen Konu: Menüleri renklendirelim  (Okunma sayısı 2230 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı Musdi42

  • Delphi 1 Level 5
  • *****
  • İleti: 45
  • Rep: +0/-0
Menüleri renklendirelim
« : 07 Mayıs 2007 18:33:02 »
öncelikle formumuza bir tane ApplicationEvents nesnesi koyuyoruz

Kodlar
___________________________________________
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, AppEvnts, Menus;

type
  TForm1 = class(TForm)
    ApplicationEvents1: TApplicationEvents;
    MainMenu1: TMainMenu;
    gfg1: TMenuItem;
    gfg2: TMenuItem;
    f1: TMenuItem;
    gf1: TMenuItem;
    procedure ApplicationEvents1Activate(Sender: TObject);
    procedure ApplicationEvents1Deactivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
private
{ Private declarations }
FOldMenuColor: TColorRef;
FOldMenuTextColor: TColorRef;
public
{ Public declarations }
end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.ApplicationEvents1Activate(Sender: TObject);
var
  newcolors: array[0..1] of TColorRef;
  indices: array[0..1] of Integer;
begin
  FOldMenuColor := ColorToRGB(clMenu);
  FOldMenuTextColor := ColorToRGB(clMenuText);
  newcolors[0] := ColorToRGB(clAqua);
  newcolors[1] := ColorToRGB(clNavy);
  indices[0] := COLOR_MENU;
  indices[1] := COLOR_MENUTEXT;
  SetSysColors(2, indices, newcolors);
end;

procedure TForm1.ApplicationEvents1Deactivate(Sender: TObject);
var
  newcolors: array[0..1] of TColorRef;
  indices: array[0..1] of Integer;
begin
  newcolors[0] := FOldMenuColor;
  newcolors[1] := FOldMenuTextColor;
  indices[0] := COLOR_MENU;
  indices[1] := COLOR_MENUTEXT;
  SetSysColors(2, indices, newcolors);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  ApplicationEvents1Deactivate(self);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin

end;

end.
________________-
not: alıntıdır : iyi çalışmlar arkadaşlar

Çevrimdışı Kocaturk

  • Administrator
  • *****
  • İleti: 2.474
  • Rep: +56/-5
  • Cinsiyet: Bay
    • Delphi Dünyası
Ynt: Menüleri renklendirelim
« Yanıtla #1 : 08 Mayıs 2007 02:10:54 »
paylaşım için tüm üşengeç üyelerimiz adına  teşekkürler :):)

Çevrimdışı woldemort

  • Delphi 1 Level 1
  • *
  • İleti: 1
  • Rep: +0/-0
Ynt: Menüleri renklendirelim
« Yanıtla #2 : 17 Ağustos 2007 12:49:27 »
ya bu çalışmıoooo