#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    113
    Rep Power
    11

    Some help, please.


    Hi All. I am new at delphi programming and really need some help.
    1) How to change the color of titlebar?
    2)How to launch mail program or go to website while clicking on a label?
    3) How to change the font name of mainmenu.items?

    Any help is highly appreciated.

    Anar
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    46
    Rep Power
    11

    Thumbs up


    Originally Posted by Ruh
    Hi All. I am new at delphi programming and really need some help.
    1) How to change the color of titlebar?

    2)How to launch mail program or go to website while clicking on a label?

    3) How to change the font name of mainmenu.items?

    Anar
    1. not too sure, proly tweaking aroun with Win32 API.
    2. http://delphi.about.com/library/weekly/aa082499.htm
    3. not sure, probably through TActionManager. Never used it so cant say much about it.

    Good luck!!
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    1. You can change the system's idea of title bar color with code like this:
    Code:
    const
    	MaxItems = 1;
    var
    	ItemList: array[1..MaxItems] of Integer;
    	ColorList: array[1..MaxItems] of TColor;
    begin
    	ItemList[1] := COLOR_ACTIVECAPTION;
    	ColorList[1] := ColorToRGB(clRed);
    	SetSysColors(MaxItems, ItemList, ColorList);
    end;
    See SetSysColors in MSDN for more info on this API call. The trouble is that when you change this color, the title color for every window in the system gets changed. If you want just your window to have a different color, consider using a component from here.
    http://www.torry.net/pages.php?id=95
    2. Use this code on a label's component.
    Code:
    uses
        ....rest of files in uses section .... , ShellApi;
    ...
    ...
    procedure TForm1.Label1DblClick(Sender: TObject);
    begin
    	ShellExecute(0, 'open', 'http://www.yahoo.com/', Nil, Nil, SW_SHOWNORMAL);
    end;
    
    procedure TForm1.Label2DblClick(Sender: TObject);
    begin
    	ShellExecute(0, 'open', 'mailto:me@somewhere.com', Nil, Nil, SW_SHOWNORMAL);
    end;
    3. See http://www.torry.net/pages.php?id=149
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    113
    Rep Power
    11
    Hi Lightnin' & Scorpions4ever,

    Thanks for your respond, it really helped me a lot.

    Just one thing still confuses me, what is the difference between ShellExecute(0, 'open',... and ShellExecute(handle, 'open',... ? Please make it clear for me.

    Anar
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    113
    Rep Power
    11
    Here goes another question,

    How to make Windows XP style ComboBox? Is there any component for this?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    2
    Rep Power
    0

    combobox xp style


    try LMD-Tools a set of 100+ comp, great!!!
    http://www.ceberus.com/lmd/

    Hi
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    113
    Rep Power
    11
    Questions follow each other

    How to assign all true type fonts into combobox?
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Posts
    113
    Rep Power
    11
    I tried LMD-tools, they are really cool, just u can't use compiled .exe file. It works only at IDE.

    I found an answer to my question, used one RichEdit & 1 ComboBox, added ComboBox1.Items:= Screen.Fonts; to onFormCreate event, and RichEdit1.Font.Name:= ComboBox1.Text; on ComboBox onChange event, that works fine for me.

    Now, I have 2 items at my combobox, English & Russian. How can I determine the selected item at combobox? For ex. on Button1Click, if the item English is selected then Begin....End, else Begin....End;
  16. #9
  17. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    Check out the free combobox components on torry's site:
    http://www.torry.net/pages.php?id=138
    http://www.torry.net/pages.php?id=134

    This is usually where I head to when I'm looking for components. Better still, quite a few of them are free and some even come with source code.

    As for your specific problem, look into the ItemIndex property of the combo box.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo