Solved

Memo's Font, Style, Color in Hexadecimal.

Posted on 1998-09-19
11
700 Views
Last Modified: 2013-12-03
Hello Experts.
 
  I have been trying to figure this out for a very long time. Memo's Font, Color, Size and Style saved into windows registry in hexadecimal. I would like to store TMemo's font settings into the windows register in hexadecimal format, including color size just like notepad does in Windows 98. If someone could provide examples please. Thank's Hyperion66
0
Comment
Question by:hyperion66
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1340254
How about this...
var
  S : string;
begin
  S := IntToHex(BUtton1.Font.color, 10);
  Caption := S;
end;

0
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1340255
Font's Color
---------------
var
       S : string;
     begin
       S := IntToHex(BUtton1.Font.color, 10);
       Caption := S;
     end;
Font's Size
---------------
var
  S : string;
begin
  S := IntToHex(Button1.Font.Size, 5);
  Caption := s;
end;

You need to figure out a way for the style...for example create your own values for each of the syles....

if it's Bold then 0
Italic 1
Bold and Italic 3
and so on....Then right them as follows

var
  s : string;
begin
  S := IntToHex(GetStyle(Memo1.Font.Style), 5);
  Caption := s;
end;

Where GetStyle() function has to return an integer./

Regards,
Viktor Ivanov
0
 

Author Comment

by:hyperion66
ID: 1340256
OK great, i know most of what you just typed except for how to use hex in the registry..i'll try the code right now and get back to you vary soon.  Thank's viktornet's.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:viktornet
ID: 1340257
Use the WriteString of the registry....
uses Registry;
{...}
var
  reg : TRegistry;
  s : String;
begin
  S := IntToHex(BUtton1.Font.color, 10);
  reg := TRegistry.Create(self);
  try
    reg.WriteString('TheKey', S);
  finally  
    reg.free;
end;

Regards,
Viktor Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340258
I forgot .....you  need to use reg.OpenKey()

//Vik
0
 

Author Comment

by:hyperion66
ID: 1340259
hmm i'm still having problems, I connaot seem to get IntToHex to work. All i want to get it to do is write this Regini.WriteInteger('','FontColor',Memp.Font.Color); into Hex format in the registry.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340260
You cannot do you the way you try.... Why not use it this way.....??

Regini.WriteString('', 'FontColor', IntToHex(Memo.Font.Color, 10));

//Vik ;->
0
 

Author Comment

by:hyperion66
ID: 1340261
No the code works, i just can't get it to read from hex..I can write it into hex but not read it from hex.
0
 

Author Comment

by:hyperion66
ID: 1340262
No the code works, i just can't get it to read from hex..I can write it into hex but cannot read it from hex.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1340263
Hello!

First you write it into the registry as a Hexadecimal string, then when you read it, read it as a string and then use a function that converts the string to a hexadecimal....

//Vik
0
 

Author Comment

by:hyperion66
ID: 1340264
Thank's Viktornet.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10 Round Image 2 189
Delphi: barcode reading on android platform 1 72
MS Access from Delphi 31 81
Firemonkey how to swip panel with finger tap 1 20
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question