78
|
Is it possible to change the line's height
![](images/excalceditq78.png)
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '(1+6.25)/4*6/3';
InsertText('(2+6.25)/4*6/3\r\n',TObject(1));
InsertText('(3+6.25)/4*6/3\r\n',TObject(1));
InsertText('(4+6.25)/4*6/3\r\n',TObject(1));
InsertText('Total',Nil);
LineHeight := 'value + 8 * dpi';
DrawGridLines := True;
end
|
77
|
How do I put a picture on the control's background
![](images/excalceditq77.png)
with AxCalcEdit1 do
begin
(GetOcx() as EXCALCEDITLib.CalcEdit).Picture := AxCalcEdit1.ExecuteTemplate('loadpicture(`c:\exontrol\images\zipdisk.gif`)');
PictureDisplay := EXCALCEDITLib.PictureDisplayEnum.exUpperLeft;
MultiLine := True;
Text := '(1+6.25)/4*6/3';
InsertText('\r\n',TObject(1));
InsertText('\r\n',TObject(1));
InsertText('\r\n',TObject(1));
OutputDebugString( 'Expression: ' );
OutputDebugString( Text );
OutputDebugString( 'Result: ' );
OutputDebugString( get_Result(Nil) );
end
|
76
|
How do I get the numbers only, with no Total fields (method 2)
![](images/excalceditq76.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatResult := '<fgcolor=808080><r> = %%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
InsertText('Total',Nil);
OutputDebugString( ExecuteTemplate('FormatABC("lower(A) replace `total` with ``", Text)') );
end
|
75
|
How do I get the numbers only, with no Total fields (method 1)
![](images/excalceditq75.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatResult := '<fgcolor=808080><r> = %%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
InsertText('Total',Nil);
OutputDebugString( FormatABC('lower(A) replace `total` with ``',TObject(Text),Nil,Nil) );
end
|
74
|
How do I customize the format to display the result (right,local,2 decimals,less,font)
![](images/excalceditq74.png)
with AxCalcEdit1 do
begin
MultiLine := True;
LineHeight := 'value + 8 * dpi';
FormatLocal := '( value < 10000 ? `<fgcolor=000000><b><font ;16>` : ``) + (value format `2`)';
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
73
|
How do I customize the format to display the result (right,local,2 decimals,greater,color)
![](images/excalceditq73.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatLocal := '( value > 10000 ? `<fgcolor=FF0000><b>` : ``) + (value format `2`)';
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
72
|
How do I customize the format to display the result (right,local,all decimals)
![](images/excalceditq72.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatLocal := 'value';
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
71
|
How do I customize the format to display the result (right,local,2 decimals)
![](images/excalceditq71.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatLocal := 'value format `2`';
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
70
|
How do I customize the format to display the result (right,local,curency)
![](images/excalceditq70.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatLocal := 'currency(value)';
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
69
|
How do I customize the format to display the result (right,local)
![](images/excalceditq69.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatResult := '<fgcolor=808080><r> = %l%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
68
|
How do I customize the format to display the result (right)
![](images/excalceditq68.png)
with AxCalcEdit1 do
begin
MultiLine := True;
FormatResult := '<fgcolor=808080><r> = %%';
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
67
|
How do I customize the format to display the result (default)
![](images/excalceditq67.png)
with AxCalcEdit1 do
begin
MultiLine := True;
InsertText('100 * 200',Nil);
InsertText('300 * 400 * 1.5',Nil);
InsertText('200 + ( 400 * 1.5 + 300 / 1.19)',Nil);
end
|
66
|
How can I force a line to be there all the time, so user can not delete it, for instance Total
![](images/excalceditq66.png)
with AxCalcEdit1 do
begin
MultiLine := True;
InsertLockedText('Total',Nil);
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
end
|
65
|
Is it possible to get the value of specified variable
![](images/excalceditq65.png)
with AxCalcEdit1 do
begin
MultiLine := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('TVA = Total * 0.19',Nil);
InsertText('Total',Nil);
OutputDebugString( 'The TVA is: ' );
OutputDebugString( get_Variable('TVA') );
end
|
64
|
How do I get the total
![](images/excalceditq64.png)
with AxCalcEdit1 do
begin
MultiLine := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
OutputDebugString( 'The total is: ' );
OutputDebugString( get_Variable('Total') );
end
|
63
|
How do I get the easter date
![](images/excalceditq63.png)
with AxCalcEdit1 do
begin
MultiLine := True;
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
ClearWildFormats();
FormatResult := '<r><fgcolor=008000><b>(%%)';
AllowComments := '<fgcolor=008000>//';
AddWildFormat('*=*<fgcolor=008000>//*');
AddWildFormat('<fgcolor=808080>V*=*');
AddWildFormat('<b>EasterSundayDay*=*');
BackColorLockedLine := Color.FromArgb(0,0,0);
ForeColorLockedLine := Color.FromArgb(0,0,0);
Text := 'Year = 2018 // change here the year, to get the Easter Sunday for giving year';
InsertLockedText('V1 = (((255 - 11 * (Year mod 19)) - 21) mod 30)',Nil);
InsertLockedText('V2 = ((V1 + 21) + (V1 > 48 ? -1 : 0) + 6 - ((Year + int(Year / 4)) + V1 + (V1 > 48 ? -1 : 0) + 1) mod 7)',Nil);
InsertLockedText('EasterSundayDay = date(dateS(''3/1/'' + Year) + V2)',Nil);
OutputDebugString( 'Easter Sunday Day is ' );
OutputDebugString( get_Variable('EasterSundayDay') );
OutputDebugString( ' for year ' );
OutputDebugString( get_Variable('Year') );
end
|
62
|
I've got a red line while I type into the control. How can I disable that (sample 2)
![](images/excalceditq62.png)
with AxCalcEdit1 do
begin
AllowFormatInvalidOnTyping := False;
MultiLine := True;
Text := '100 + 200(invalid)';
end
|
61
|
I've got a red line while I type into the control. How can I disable that (sample 1)
![](images/excalceditq61.png)
with AxCalcEdit1 do
begin
FormatInvalid := '';
Text := '100 + 200(invalid)';
end
|
60
|
How do I specify the color to show the locked lines
![](images/excalceditq60.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatResult := '<r>[=%l%]';
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> <fgcolor=FFFFFF>= %l%</b>';
BackColorLockedLine := Color.FromArgb(0,0,1);
ForeColorLockedLine := Color.FromArgb(255,255,255);
InsertText('100',Nil);
InsertText('200',Nil);
InsertLockedText('VAT = Total * 0.20',Nil);
InsertLockedText('Total',Nil);
end
|
59
|
Can I remove the colors that indicates locked lines
![](images/excalceditq59.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatResult := '<r><fgcolor=808080>[=%l%]';
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> = %l%</b>';
BackColorLockedLine := Color.FromArgb(0,0,0);
ForeColorLockedLine := Color.FromArgb(0,0,0);
InsertText('100',Nil);
InsertText('200',Nil);
InsertLockedText('VAT = Total * 0.20',Nil);
InsertLockedText('Total',Nil);
end
|
58
|
Can I add lines to the control, so the user can not remove/delete them ( locked lines )
![](images/excalceditq58.png)
with AxCalcEdit1 do
begin
MultiLine := True;
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatResult := '<r><fgcolor=808080>[=%l%]';
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> = %l%</b>';
Text := '1000';
InsertText('2000',Nil);
InsertLockedText('Commission = Total * 0.05 + (Total ? 2.95 : 0)',Nil);
InsertLockedText('Total',Nil);
end
|
57
|
Is it possible to highlight a specified line
![](images/excalceditq57.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatResult := '<r><fgcolor=808080>[=%l%]';
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> = %l%</b>';
AddWildFormat('<fgcolor=00FF00>*<b>Commission</b>*=*');
Text := '100.50 + 123';
InsertText('200 + 20/5',Nil);
InsertText('300 + 3 * 15',Nil);
InsertText('400 + 200 * (10 + 12/45)',Nil);
InsertText('50 * 45',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Monthly = Total / 12',Nil);
InsertText('Commission = Total * 0.05 + 2.95',Nil);
InsertText('Total',Nil);
end
|
56
|
Is it possible to display the result as currency
![](images/excalceditq56.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> = %l%</b>';
BackColorTotal := Color.FromArgb(240,240,240);
Text := '100.50';
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Total',Nil);
end
|
55
|
Is it possible to display the result with no decimals
![](images/excalceditq55.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatLocal := 'value format `0`';
FormatTotalResult := '<r><b> = %l%</b>';
BackColorTotal := Color.FromArgb(240,240,240);
Text := '100.50';
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Total',Nil);
end
|
54
|
Is it possible to display the result exactly how it is defined in the control panel
![](images/excalceditq54.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatLocal := 'value format ``';
FormatTotalResult := '<r><b> = %l%</b>';
BackColorTotal := Color.FromArgb(240,240,240);
Text := '100.50';
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Total',Nil);
end
|
53
|
How can I count the lines
![](images/excalceditq53.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowCount := 'count';
AllowSubCount := 'subcount';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('SubCount',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('500',Nil);
InsertText('SubCount',Nil);
InsertText('Count',Nil);
end
|
52
|
How can I compute the average
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatTotalResult := '<r><b> = %l%</b>';
BackColorTotal := Color.FromArgb(240,240,240);
Text := 'Average = Total / Count';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Total',Nil);
end
|
51
|
Variables or Computed Fields
![](images/excalceditq51.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatTotalResult := '<r><b> = %l%</b>';
BackColorTotal := Color.FromArgb(240,240,240);
Text := '100';
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('VAT = Total * 0.19',Nil);
InsertText('NET = Total - VAT',Nil);
InsertText('Total',Nil);
end
|
50
|
I have noticed that definition of the variable is shown in italics. Can I change that
![](images/excalceditq50.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
ClearWildFormats();
AddWildFormat('<b>*=*');
Text := 'A = 400';
InsertText('',Nil);
InsertText('B = A + 0.22',Nil);
InsertText('A + B',Nil);
InsertText('B = B * .19',Nil);
InsertText('A + B',Nil);
end
|
49
|
I have noticed that definition of the variable is shown in italics. Can I remove that
![](images/excalceditq49.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
ClearWildFormats();
Text := 'A = 300';
InsertText('',Nil);
InsertText('B = A + 0.22',Nil);
InsertText('A + B',Nil);
InsertText('B = B * .19',Nil);
InsertText('A + B',Nil);
end
|
48
|
Can I define variables (sample 2)
![](images/excalceditq48.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := 'is';
ClearWildFormats();
AddWildFormat('<b>*is*');
Text := 'A is 200';
InsertText('',Nil);
InsertText('B is A + 0.22',Nil);
InsertText('A + B',Nil);
InsertText('B is B * .19',Nil);
InsertText('A + B',Nil);
end
|
47
|
Can I define variables (sample 1)
![](images/excalceditq47.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowVariables := '=';
Text := 'A = 100.22';
InsertText('',Nil);
InsertText('B = A + 0.22',Nil);
InsertText('A + B',Nil);
InsertText('B = B * .19',Nil);
InsertText('A + B',Nil);
end
|
46
|
Comments and Prefixes
![](images/excalceditq46.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowPrefixes := '<fgcolor=808080>:</fgcolor>';
AllowComments := '<fgcolor=008080>''</fgcolor>';
Text := 'Field A: 100 '' this is the field A';
InsertText('Field B: 200 '' this is the field B',Nil);
InsertText('Total',Nil);
end
|
45
|
Can I display something at the start of each line
![](images/excalceditq45.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowPrefixes := '<b>:</b>';
Text := 'Field A: 100';
InsertText('Field B: 200',Nil);
InsertText('Total',Nil);
end
|
44
|
I can not use TAB key. Is it possible
with AxCalcEdit1 do
begin
UseTabKey := True;
end
|
43
|
Does your control support comments
![](images/excalceditq43.png)
with AxCalcEdit1 do
begin
MultiLine := True;
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
AllowComments := '<fgcolor=008080>//</fgcolor>';
Text := '104 mod 51 // modulo function';
InsertText('int(104/51) // int function',Nil);
InsertText('51 * int(104/51) + (104 mod 51) // check',Nil);
end
|
42
|
Can I use the modulo function ( rest )
![](images/excalceditq42.png)
with AxCalcEdit1 do
begin
MultiLine := True;
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := '104 mod 51';
InsertText('int(104/51)',Nil);
InsertText('51 * int(104/51) + (104 mod 51)',Nil);
end
|
41
|
Can I use acos function
![](images/excalceditq41.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'acos(cos(1))';
end
|
40
|
Can I use asin function
![](images/excalceditq40.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'asin(sin(1))';
end
|
39
|
Can I use cos function
![](images/excalceditq39.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'cos(1)';
end
|
38
|
Can I use sin function
![](images/excalceditq38.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'sin(1)';
end
|
37
|
Can I use abs function (absolute part of the number)
![](images/excalceditq37.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'abs(-100.99)';
end
|
36
|
Can I use round function
![](images/excalceditq36.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'round(100.99)';
end
|
35
|
Can I use int function (integer part of a number)
![](images/excalceditq35.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'int(100.99)';
end
|
34
|
Can I use sqrt function (square root of a number)
![](images/excalceditq34.png)
with AxCalcEdit1 do
begin
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := 'sqrt(100)';
end
|
33
|
How can I show invalid lines with a larger font
![](images/excalceditq33.png)
with AxCalcEdit1 do
begin
MultiLine := True;
LineHeight := 'value + 8 *dpi';
DrawGridLines := True;
FormatInvalid := '<u><font ;12> </font></u>';
InsertText('100',Nil);
InsertText('k200',Nil);
InsertText('300',Nil);
end
|
32
|
I've noticed that while I type the text is shown in red. How can I change that
![](images/excalceditq32.png)
with AxCalcEdit1 do
begin
FormatInvalid := '';
Text := '100 * 200';
end
|
31
|
Can I enlarge the height of each line
![](images/excalceditq31.png)
with AxCalcEdit1 do
begin
MultiLine := True;
LineHeight := 'value + 8 * dpi';
DrawGridLines := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
30
|
How can I show grid lines
![](images/excalceditq30.png)
with AxCalcEdit1 do
begin
MultiLine := True;
DrawGridLines := True;
GridLineColor := Color.FromArgb(0,0,0);
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
29
|
How can I display the result of the total with a larger font
![](images/excalceditq29.png)
with AxCalcEdit1 do
begin
MultiLine := True;
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
FormatTotalResult := '<r><b><font ;14>%l%</font></b>';
AllowTotal := '<b><font ;14>Total</font></b>';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
28
|
Is it possible to show the Total / SubTotal with a different background color
![](images/excalceditq28.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowTotal := '<bgcolor=A0A0A0><b>Total</b></bgcolor>';
AllowSubTotal := '<bgcolor=E0E0E0><b>SubTotal</b></bgcolor>';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('SubTotal',Nil);
InsertText('300',Nil);
InsertText('400 * 1.5',Nil);
InsertText('SubTotal',Nil);
InsertText('Total',Nil);
end
|
27
|
Is it possible to show the Total / SubTotal with a different background color
![](images/excalceditq27.png)
with AxCalcEdit1 do
begin
MultiLine := True;
BackColorTotal := Color.FromArgb(196,196,196);
BackColorSubTotal := Color.FromArgb(240,240,240);
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('SubTotal',Nil);
InsertText('300',Nil);
InsertText('400 * 1.5',Nil);
InsertText('SubTotal',Nil);
InsertText('Total',Nil);
end
|
26
|
How can I change the color to show the numbers
![](images/excalceditq26.png)
with AxCalcEdit1 do
begin
FormatNumbers := '<fgcolor=FF0000> </fgcolor>';
Text := '1 + 2 + 3 + 4';
end
|
25
|
The numbers are shown in blue. How can I remove that
![](images/excalceditq25.png)
with AxCalcEdit1 do
begin
FormatNumbers := '';
Text := '1 + 2 + 3 + 4';
end
|
24
|
How can I export the entire text, including the result
![](images/excalceditq24.png)
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('120 * 1.5',Nil);
InsertText('130 * 1.5',Nil);
InsertText('Total',Nil);
OutputDebugString( Export );
end
|
23
|
Is it possible to display the result, using the current regional locale
![](images/excalceditq23.png)
with AxCalcEdit1 do
begin
MultiLine := True;
DrawGridLines := True;
FormatResult := ' <fgcolor=808080>[=%l%]</fgcolor>';
FormatTotalResult := ' <b>[=%l%]</b>';
InsertText('100 * 100',Nil);
InsertText('200 * 200',Nil);
InsertText('300 * 300',Nil);
InsertText('Total',Nil);
end
|
22
|
How can I change the format to display the total result (right)
![](images/excalceditq22.png)
with AxCalcEdit1 do
begin
MultiLine := True;
DrawGridLines := True;
FormatTotalResult := '<b><fgcolor=FF0000> = %l%</fgcolor></b>';
AllowTotal := '<b><fgcolor=00FF00>Total</fgcolor></b>';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
21
|
How can I change the format to display the total result (right)
![](images/excalceditq21.png)
with AxCalcEdit1 do
begin
MultiLine := True;
DrawGridLines := True;
LineHeight := 'value + 4 * dpi';
FormatTotalResult := '<r><b><font ;12>%l%</font></b>';
AllowTotal := '<b><font ;12>Total</font></b>';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
20
|
Is it possible to rename the SubTotal
![](images/excalceditq20.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowSubTotal := '<fgcolor=FF0000>Current Amount';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('Current Amount',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('Current Amount',Nil);
InsertText('Total',Nil);
end
|
19
|
How can I disable the sub-totals
![](images/excalceditq19.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowSubTotal := '';
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('SubTotal',Nil);
InsertText('300',Nil);
InsertText('400',Nil);
InsertText('SubTotal',Nil);
InsertText('Total',Nil);
end
|
18
|
How can I add sub-totals
![](images/excalceditq18.png)
with AxCalcEdit1 do
begin
MultiLine := True;
AllowComments := '<fgcolor=008000>''';
AddWildFormat('<i>*=*<fgcolor=008000>''*');
AllowVariables := '=';
DrawGridLines := True;
LineHeight := 'value + 8 * dpi';
GridLineColor := Color.FromArgb(196,196,196);
FormatLocal := 'currency(value)';
FormatTotalResult := '<r><b> = %l%</b>';
FormatSubTotalResult := '<r><fgcolor=808080>[<b> = %l%</b>]';
FormatResult := '<r><fgcolor=808080>(%l%)';
BackColorTotal := Color.FromArgb(240,240,240);
BackColorLockedLine := Color.FromArgb(0,0,0);
ForeColorLockedLine := Color.FromArgb(0,0,0);
CalcType := EXCALCEDITLib.CalcTypeEnum.exCalcIncludeAll;
Text := '100 + 200';
InsertText('200 * 1.5',Nil);
InsertText('SubA = SubTotal '' first subtotal',Nil);
InsertText('300 + (200+300)/2',Nil);
InsertText('400 + 500',Nil);
InsertText('SubB = SubTotal '' second subtotal',Nil);
InsertLockedText('VAT = Total * 0.19',Nil);
InsertLockedText('Commision = Total * 0.05',Nil);
InsertLockedText('NET = (Total - VAT) - Commision',Nil);
InsertLockedText('Total',Nil);
end
|
17
|
Is it possible to disable the Total
![](images/excalceditq17.png)
with AxCalcEdit1 do
begin
AllowTotal := '';
MultiLine := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
16
|
Is it possible to rename the Total to Sum
![](images/excalceditq16.png)
with AxCalcEdit1 do
begin
AllowTotal := '<fgcolor=FF0000><b>Sum</b></fgcolor>';
MultiLine := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Sum',Nil);
end
|
15
|
Is it possible to add all lines
![](images/excalceditq15.png)
with AxCalcEdit1 do
begin
MultiLine := True;
InsertText('100',Nil);
InsertText('200',Nil);
InsertText('300',Nil);
InsertText('Total',Nil);
end
|
14
|
How do I insert / add a new line
![](images/excalceditq14.png)
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('120 * 2.5\r\n',TObject(1));
InsertText('200 * 1.5',Nil);
end
|
13
|
How do I find out if a specified line is valid
![](images/excalceditq13.png)
// SelChange event - Occurs when the user selects text in the control.
procedure TWinForm1.AxCalcEdit1_SelChange(sender: System.Object; e: System.EventArgs);
begin
with AxCalcEdit1 do
begin
OutputDebugString( 'CurrentLine: ' );
OutputDebugString( CaretLine );
OutputDebugString( 'CurrentLine: ' );
OutputDebugString( get_TextLine(CaretLine) );
OutputDebugString( 'IsValid: ' );
OutputDebugString( get_IsValid(TObject(CaretLine)) );
end
end;
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('invalid',Nil);
InsertText('120 * 1.5',Nil);
InsertText('130 * 1.5',Nil);
end
|
12
|
How do I get the current line
![](images/excalceditq12.png)
// SelChange event - Occurs when the user selects text in the control.
procedure TWinForm1.AxCalcEdit1_SelChange(sender: System.Object; e: System.EventArgs);
begin
with AxCalcEdit1 do
begin
OutputDebugString( 'CurrentLine: ' );
OutputDebugString( CaretLine );
OutputDebugString( 'CurrentLine: ' );
OutputDebugString( get_TextLine(CaretLine) );
OutputDebugString( 'CurrentResult: ' );
OutputDebugString( get_Result(TObject(CaretLine)) );
end
end;
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('120 * 1.5',Nil);
InsertText('130 * 1.5',Nil);
end
|
11
|
How do I get the line one by one, including the result
![](images/excalceditq11.png)
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('120 * 1.5',Nil);
InsertText('130 * 1.5',Nil);
OutputDebugString( 'Lines:' );
OutputDebugString( Count );
OutputDebugString( 'TextLine(1):' );
OutputDebugString( get_TextLine(1) );
OutputDebugString( 'Result(1)' );
OutputDebugString( get_Result(TObject(1)) );
OutputDebugString( 'TextLine(2):' );
OutputDebugString( get_TextLine(2) );
OutputDebugString( 'Result(2)' );
OutputDebugString( get_Result(TObject(2)) );
OutputDebugString( 'TextLine(3):' );
OutputDebugString( get_TextLine(3) );
OutputDebugString( 'Result(3)' );
OutputDebugString( get_Result(TObject(3)) );
end
|
10
|
Does the control supports multiple lines
![](images/excalceditq10.png)
with AxCalcEdit1 do
begin
MultiLine := True;
Text := '100 * 1.5';
InsertText('120 * 1.5',Nil);
InsertText('130 * 1.5',Nil);
end
|
9
|
Is it possible to display the result without brakets
![](images/excalceditq9.png)
with AxCalcEdit1 do
begin
FormatResult := '<fgcolor=808080> = %%</fgcolor>';
Text := '12 + (12 / 100)/2';
end
|
8
|
How can I display the result on the right side of the control
![](images/excalceditq8.png)
with AxCalcEdit1 do
begin
FormatResult := '<r> <fgcolor=808080>[=%%]</fgcolor>';
Text := '12 + (12 / 100)/2';
end
|
7
|
Can you please advise how to change fontname and size (sample 2)
![](images/excalceditq7.png)
with AxCalcEdit1 do
begin
Template := 'Font.Size = 20; Font.Name = `Tahoma`; Refresh';
Text := '1/2';
end
|
6
|
Can you please advise how to change fontname and size (sample 1)
![](images/excalceditq6.png)
with AxCalcEdit1 do
begin
Font.Size := 20;
Text := '1/2';
Refresh();
end
|
5
|
How can I disable evaluating the selection
![](images/excalceditq5.png)
with AxCalcEdit1 do
begin
EvaluateSel := False;
HideSelection := False;
Text := '(1+6.25)/4*6/3';
SelStart := 1;
SelLength := 6;
SelBackColor := Color.FromArgb(0,0,0);
end
|
4
|
Can I define a different decimal separator
![](images/excalceditq4.png)
with AxCalcEdit1 do
begin
AddDecimalSep := ',';
Text := '(1+6,25)/4*6/3';
end
|
3
|
How do I change the color of the entire control, if the expression is not valid
![](images/excalceditq3.png)
// Change event - Indicates that the control's text has changed.
procedure TWinForm1.AxCalcEdit1_Change(sender: System.Object; e: System.EventArgs);
begin
with AxCalcEdit1 do
begin
OutputDebugString( 'Valid:' );
OutputDebugString( get_IsValid(Nil) );
ForeColor := Color.FromArgb(255,0,0);
FormatNumbers := '<fgcolor FF0000>';
FormatResult := '';
end
end;
with AxCalcEdit1 do
begin
FormatInvalid := '';
Text := 'invalid(1+6.25)/4*6/3';
end
|
2
|
Is there any function to know if the expression is valid
![](images/excalceditq2.png)
// Change event - Indicates that the control's text has changed.
procedure TWinForm1.AxCalcEdit1_Change(sender: System.Object; e: System.EventArgs);
begin
with AxCalcEdit1 do
begin
OutputDebugString( 'Valid:' );
OutputDebugString( get_IsValid(Nil) );
OutputDebugString( 'Expression: ' );
OutputDebugString( Text );
OutputDebugString( 'Result: ' );
OutputDebugString( get_Result(Nil) );
end
end;
with AxCalcEdit1 do
begin
Text := '(1+6.25)/4*6/3';
end
|
1
|
How do I programatically save / load the expression and the result
![](images/excalceditq1.png)
with AxCalcEdit1 do
begin
Text := '(1+6.25)/4*6/3';
OutputDebugString( 'Expression: ' );
OutputDebugString( Text );
OutputDebugString( 'Result: ' );
OutputDebugString( get_Result(Nil) );
end
|