function GetIniBool(
const Section, Key:
String;
const: Boolean; const Filename:
String): Boolean;
function GetIniInt(
const Section, Key:
String;
const Default, Min, Max: Longint;
const Filename:
String): Longint;
function GetIniString(
const Section, Key, Default, Filename:
String):
String;
Code:
Example:
var
sCaption: string;
iLeft, iTop, iWidth, iHeight: integer;
bChecked: boolean;
sCaption:=GetIniString('chkb', 'Caption', 'Component 1', ExpandConstant('{src}') + '\YourFile.ini');
iLeft:=GetIniInt('chkb', 'Left', '30', ExpandConstant('{src}') + '\YourFile.ini');
iTop:=GetIniInt('chkb', 'Top', '50', ExpandConstant('{src}') + '\YourFile.ini');
iWidth:=GetIniInt('chkb', 'Width', '150', ExpandConstant('{src}') + '\YourFile.ini');
iHeight:=GetIniInt('chkb', 'Height', '20', ExpandConstant('{src}') + '\YourFile.ini');
bChecked=GetIniBool('chkb', 'Checked', 'true', ExpandConstant('{src}') + '\YourFile.ini');
CheckBox1.Caption:=sCaption;
CheckBox1.SetBounds(iLeft, iTop, iWidth, iHeight);
CheckBox1.Checked:=bChecked;