Aug 5, 2009 #1 hbez Instructor Joined Mar 25, 2003 Messages 49 Location ZA Could someone please show me a simple method for retrieving the currency symbol from the Regional Settings on my PC?
Could someone please show me a simple method for retrieving the currency symbol from the Regional Settings on my PC?
Aug 6, 2009 #2 towerbase Programmer Joined Jul 31, 2002 Messages 1,053 Location GB Have you tried Google? I googled on Delphi Regional Settings and found this which seems to be a useful class: http://www.gtdelphicomponents.gr/?p=66 You can use it something like this: Code: uses o_RegionalSettings; procedure TForm1.Button1Click(Sender: TObject); var rs: TgtRegionalSettings; begin rs := TgtRegionalSettings.Create(nil); try edit1.text := rs.SysCurrencySymbol; finally rs.Free; end; end; Andrew Hampshire, UK Upvote 0 Downvote
Have you tried Google? I googled on Delphi Regional Settings and found this which seems to be a useful class: http://www.gtdelphicomponents.gr/?p=66 You can use it something like this: Code: uses o_RegionalSettings; procedure TForm1.Button1Click(Sender: TObject); var rs: TgtRegionalSettings; begin rs := TgtRegionalSettings.Create(nil); try edit1.text := rs.SysCurrencySymbol; finally rs.Free; end; end; Andrew Hampshire, UK
Aug 6, 2009 Thread starter #3 hbez Instructor Joined Mar 25, 2003 Messages 49 Location ZA After a LONG search I came up with: procedure TForm1.FormActivate(Sender: TObject); var formatSettings : TFormatSettings; begin GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, formatSettings); lbl1.Caption := formatSettings.CurrencyString; end; I'll give your suggestion a try as well. Thanks Hannes Upvote 0 Downvote
After a LONG search I came up with: procedure TForm1.FormActivate(Sender: TObject); var formatSettings : TFormatSettings; begin GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, formatSettings); lbl1.Caption := formatSettings.CurrencyString; end; I'll give your suggestion a try as well. Thanks Hannes