Posts by Tmc • 2,548 points
66 posts
-
1
votes2
answers615
viewsA: Doubt with cursor in memo
With the help of @Victorzanella and his response I developed the Project is not yet 100%, but already does what I wanted, when I finish I update: unit Unit1; interface uses Windows, Messages,…
-
0
votes2
answers2042
viewsA: Remove penultimate character from a string
There are several ways to do this is one of them, just create the following Function: function TfrmMain.GetResult(val1: String): String; var val2, val3: String; begin val2 := copy(val1, 1,…
-
0
votes3
answers633
viewsA: Tdictionary, how to destroy it
Forehead as follows:: destructor TMemCorrectedDictionary.Destroy; begin inherited; Values.Free; Keys.Free; end; More information here: Memory Leak in Tdictionary - Problems with Workaround?…
-
-1
votes1
answer392
views -
3
votes2
answers615
viewsQ: Doubt with cursor in memo
In my project VCL, I have a TMemo with the following text(| is cursor): | | |Hello world | | | | |test | | | | | When I press on Down button, the cursor moves here: | | |Hello world | || | |test | |…
-
-2
votes1
answer444
views -
1
votes2
answers924
viewsA: Know how many properties an INI session has?
Can be done as follows, creates a new project insert a TButton and a TMemo and at the event onclick From the button paste the following code: procedure TForm1.Btn1Click(Sender: TObject); var VCount:…
-
4
votes1
answer3038
viewsQ: How to change the form buttons (minimize, maximize and close)
I have a project in Delphi 2010 where you would like to change the buttons icons Minimize, Maximize, Close-up that are represented in the image below: The icons I want to use were created by me, so…
-
0
votes1
answer345
views -
8
votes2
answers8954
viewsA: Calculate distance between two points by latitude and longitude
Try this code with me it worked: function sgn(a: real): real; begin if a < 0 then sgn := -1 else sgn := 1; end; function atan2(y, x: real): real; begin if x > 0 then atan2 := arctan(y/x) else…
-
3
votes1
answer79
viewsA: How to set a page size with Ravereport
Solution to my problem: procedure TfrmLogger.RvSystemBeforePrint(Sender: TObject); begin with Sender as TBaseReport do begin Units := unInch; UnitsFactor := 1; SetPaperSize(DMPAPER_USER, 21, 29.7);…
-
1
votes1
answer79
viewsQ: How to set a page size with Ravereport
I have a project in Delphi 2010 in which I use Ravereport to make PDF reports, my question and the following and possible to define the size Width Heigth from the PDF page. I tried it but it makes a…
-
2
votes1
answer210
viewsQ: How to close a "folder"
I have a project in Delphi 2010 that when I click on a button opens a directory, this is the code: DirFolder := 'C:\teste'; ShellExecute(Handle, 'open', PChar(DirFolder), nil, nil, SW_SHOWNORMAL);…
-
1
votes1
answer1416
viewsA: Generate an XLS without using Excel (BIFF)
This may be a solution to your problem, just create a table in html and export as Xls, example: procedure TForm1.Button1Click(Sender: TObject); var XlsFile: TextFile; i: integer; begin…
-
1
votes1
answer391
viewsA: Doubt with Thread
The basic code to create a Thread is the following, just replace the code you write in the memo by code to change image, I tried to detail all the steps as best as possible: //Declaração da thread…
-
3
votes2
answers397
viewsA: Doubt to "check" a radiobutton by clicking on an image
To do this is enough to add the following code in the event onclick of imagem3, and the Radiobutton will pass to check in: procedure TForm1.Image3Click(Sender: TObject); begin radiobutton3.Checked…