Delphi

RichEdit does not process hyperlinks

核能气质少年 提交于 2020-01-02 11:05:43
问题 I want my RichEdit to process hyperlinks, so I followed the instructions on: http://delphi.about.com/od/vclusing/l/aa111803a.htm Here are the changes I made to the code: interface type TProgCorner = class(TForm) RichEdit2: TRichEdit; RichEdit1: TRichEdit; RichEdit3: TRichEdit; RichEdit4: TRichEdit; procedure FormCreate(Sender: TObject); private procedure InitRichEditURLDetection(RE: TRichEdit); protected procedure WndProc(var Msg: TMessage); override; end; implementation {$R *.DFM} uses

OnDrawCell Center Text StringGrid - Delphi

≡放荡痞女 提交于 2020-01-02 10:33:12
问题 I'm trying to get the text in my StringGrid to center. After some research I came up with this function posted by someone else here that when used on DefaultDraw:False should work. procedure TForm1.StringGrid2DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var S: string; SavedAlign: word; begin if ACol = 1 then begin // ACol is zero based S := StringGrid1.Cells[ACol, ARow]; // cell contents SavedAlign := SetTextAlign(StringGrid1.Canvas.Handle, TA_CENTER);

OnDrawCell Center Text StringGrid - Delphi

≯℡__Kan透↙ 提交于 2020-01-02 10:32:11
问题 I'm trying to get the text in my StringGrid to center. After some research I came up with this function posted by someone else here that when used on DefaultDraw:False should work. procedure TForm1.StringGrid2DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var S: string; SavedAlign: word; begin if ACol = 1 then begin // ACol is zero based S := StringGrid1.Cells[ACol, ARow]; // cell contents SavedAlign := SetTextAlign(StringGrid1.Canvas.Handle, TA_CENTER);

list index out of bounds (0)

为君一笑 提交于 2020-01-02 10:06:32
问题 i posted a question on Fixing an error in a method declaration in a form in Delphi but after getting it fixed another error popped up upon compiling and its saying project project1.exe raised exception class EStringListError with message 'list index out of bounds(0)'.when i press continue its not working but when i press break its flashing on the code neraz:=true; this is my code below Procedure Reload; var i:integer; begin form1.ListBox1.Clear; form1.ListBox2.Clear; if neraz then HD; neraz:

How to create child layered alpha-transparent window?

落爺英雄遲暮 提交于 2020-01-02 09:13:44
问题 I am trying to create transparent child window. procedure TForm1.BtnGoClick(Sender: TObject); var bmp:TBitmap; BitmapPos: TPoint; BitmapSize: TSIZE; BlendFunction: _BLENDFUNCTION; exStyle: Cardinal; begin bmp := TBitmap.Create; bmp.LoadFromFile('my32bitbitmap.bmp'); exStyle := GetWindowLongA(Form2.Handle, GWL_EXSTYLE); if (exStyle and WS_EX_LAYERED = 0) then SetWindowLong(Form2.Handle, GWL_EXSTYLE, exStyle or WS_EX_LAYERED); BitmapPos := Point(0, 0); BitmapSize.cx := bmp.Width; BitmapSize.cy

Unexpected failure of custom registered Reverter using TJSONUnMarshal

微笑、不失礼 提交于 2020-01-02 08:58:32
问题 The code below is from the JSonMarshall project in chapter 7 of Marco Cantu's Delphi 2010 Handbook. The source code is available from here http://cc.embarcadero.com/item/27600. I have made two changes to it: Add JSon to the implementation Uses clause to get it to compile. Added the line theName := 'XXX'; // added by me to the TDataWithList.Create constructor to assist debugging I am running the code in Delphi Seattle (without update 1) The purpose of the project is to demo a custom converter

Unexpected failure of custom registered Reverter using TJSONUnMarshal

女生的网名这么多〃 提交于 2020-01-02 08:58:30
问题 The code below is from the JSonMarshall project in chapter 7 of Marco Cantu's Delphi 2010 Handbook. The source code is available from here http://cc.embarcadero.com/item/27600. I have made two changes to it: Add JSon to the implementation Uses clause to get it to compile. Added the line theName := 'XXX'; // added by me to the TDataWithList.Create constructor to assist debugging I am running the code in Delphi Seattle (without update 1) The purpose of the project is to demo a custom converter

Sorting of Arrays Alphabetically?

限于喜欢 提交于 2020-01-02 08:43:31
问题 Say I have two arrays of string, named 'arrayone' and 'arraytwo' How would I go about sorting the 'arrayone' alphabetically (from A to Z), while still keeping relations to my second array. Incase you were wondering what is in 'arrayone' and 'arraytwo', 1 has surnames and 2 has the ages of each person. My end result is to add it to a richedit. Example of scenario: Smith 25 Appleseed 32 Gibbs 45 Must turn into: Appleseed 32 Gibbs 45 Smith 25 Please no stringlist, keep it in simple array and in

Sorting of Arrays Alphabetically?

久未见 提交于 2020-01-02 08:42:30
问题 Say I have two arrays of string, named 'arrayone' and 'arraytwo' How would I go about sorting the 'arrayone' alphabetically (from A to Z), while still keeping relations to my second array. Incase you were wondering what is in 'arrayone' and 'arraytwo', 1 has surnames and 2 has the ages of each person. My end result is to add it to a richedit. Example of scenario: Smith 25 Appleseed 32 Gibbs 45 Must turn into: Appleseed 32 Gibbs 45 Smith 25 Please no stringlist, keep it in simple array and in

create non visual activex control with delphi

拥有回忆 提交于 2020-01-02 08:09:34
问题 i was created a nonvisual vcl component in delphi and I'm trying to make it usable for other environment like visual studio, and i think the best way is create an activex control. but the problem is i haven't any experience about creating activex in delphi. i found some resource by google about creating activex in delphi but most of them work on visual controls but my component is non visual... anyway i hope someone help me in clear way to do this. thanks for your time. 回答1: @cyberw0lf, check