Delphi

Delphi 7 - TDBGrid style

痴心易碎 提交于 2020-01-06 08:10:39
问题 How to use stylized table in Delphi 7? For example: 回答1: If you mean which you want themed the TDbGrid component, you can use the Themed DBGrid runtime replacement from Jeremy North's and Andreas Hausladen. 回答2: I wrote and tested for you this example on Delphi 7 and Windows 8.1 Use Event DrawColumnCell to change color or something else. procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState); begin try if Column

Delphi 5 & Crystal XI Rel. 2 (RDC) how to?

天涯浪子 提交于 2020-01-06 07:43:24
问题 I'm trying to work with the class from JosephStyons but I do get an "Invalid Index" Error on the line where the "User ID" should get set. FRpt.Database.Tables[i].ConnectionProperties.Item['User ID'] := edUserName.Text; Here's my environment: WinXP Sp3, Crystal Reports Developer XI Rel.2 SP4, Delphi 5 Update Pack 1 Any help or ideas greatly appreciated! Thx, Reinhard 回答1: Your value for [i] could be the culprit...I can't remember for sure but I believe the first table will be Table[1] instead

Empty strings in Delphi

筅森魡賤 提交于 2020-01-06 07:09:31
问题 my problem is as follows: WideCompareStr(FName,'')<>0 returns false even with FName set to ''. WideCompareStr(trim(FName),'')<>0 returns the desired result. Why do I have to trim an empty string ('') for a comparison with another empty sting to get the correct result? EDIT: to clear things up: I had the following Code to test wether a widestring-variable is the empty string or not. function TSybVerwandlung.isEmpty: Boolean; var I : Integer; begin Result:=true; if WideCompareStr(FName,'')<>0

finding which form the input field belongs to delphi

谁都会走 提交于 2020-01-06 05:46:08
问题 Follow my previous question which i managed to answer myself. I am able to place text in an input field on a website served on webbrowser in a delphi application. sometimes there are multiple forms on a website, most of the time its around 2, but it could head up to a faire few. Now my question is. How can I 'test' or find out which form the selected input field belongs. Lets just take an example. For example, gmail.com there are 2 input fields: 'Email' and 'Passwd' I also know that there are

How to add and use a resource from a custom package/component in Delphi?

回眸只為那壹抹淺笑 提交于 2020-01-06 05:39:09
问题 I want to make a component that uses some resources compiled in my package's project . My component will try to use this resource (a PNG image) during runtime (at its constructor). I want to use it in my application's project , but as soon as the component gets created, I get the following exception: First chance exception at $7579B9BC. Exception class EResNotFound with message 'Resource xxx not found'. Process yyy.exe (6060) What am I missing here? EDIT The calling code for the resource in

how to write on a partition that I previously lock (using Delphi)

微笑、不失礼 提交于 2020-01-06 05:35:15
问题 I want to lock a partition, write a few files using TFileStream and then unlock it. I found how to lock and unlock but I don't know how to write. So far my code is: Const FSCTL_LOCK_VOLUME = $00090018; FSCTL_UNLOCK_VOLUME = $0009001C; var HLockedVol: THandle; implementation {$R *.dfm} function LockDrive(Drive: AnsiChar): Boolean; var OldMode: UINT; BytesReturned: Cardinal; begin Result := False; OldMode := SetErrorMode(SEM_FAILCRITICALERRORS); try HLockedVol := CreateFile(PChar(Format('\\.\%s

eBay Trading API - calling structure in Delphi

感情迁移 提交于 2020-01-06 05:31:07
问题 I am trying to call eBay API through Delphi. After long time searching through Google and StackOverflow, I can get "GeteBayTime" (Shopping API) and "findItemsByKeywords" (Finding API) work properly now. When I started to test with Trading API, I have no idea where and how to insert seller's account info (userid and password). My first program for trading API is shown below and it is started with API call "GetSellingManagerSoldListings". Can any one show me some clue to make Trading API work?

Delphi 小知识汇总

时光怂恿深爱的人放手 提交于 2020-01-06 05:07:05
一些delphi开发的小技巧2008-04-22 21:16这是我从网上收集到的一些delphi开发的小技巧,现在与大家一起分享 ◇[DELPHI]网络邻居复制文件 uses shellapi; copyfile(pchar('newfile.txt'),pchar('//computername/direction/targer.txt'),false); ◇[DELPHI]产生鼠标拖动效果 通过MouseMove事件、DragOver事件、EndDrag事件实现,例如在PANEL上的LABEL: var xpanel,ypanel,xlabel,ylabel:integer; PANEL的MouseMove事件:xpanel:=x;ypanel:=y; PANEL的DragOver事件:xpanel:=x;ypanel:=y; LABEL的MouseMove事件:xlabel:=x;ylabel:=y; LABEL的EndDrag事件:label.left:=xpanel-xlabel;label.top:=ypanel-ylabel; ◇[DELPHI]取得WINDOWS目录 uses shellapi; var windir:array[0..255] of char; getwindowsdirectory(windir,sizeof(windir));

TPanel color is black no matter what

无人久伴 提交于 2020-01-06 04:53:48
问题 I just activated the themes in my Windows XP (usually I work using the classic Win9x look) and I have seen that two panels are pure black. Other panels are ok (color = clBtnFace). What these 2 panels have in common is their parent. Both are placed directly on a TForm. If I move them to a different parent (another panel for example) the have the appropriate color. Delphi 7, win xp pro 回答1: This is another grandiose Delphi bug. I started do delete stuff from my project and recompile the project

Statement expected but Function found error in my function code

三世轮回 提交于 2020-01-06 04:43:06
问题 So below is the module of code I have created to verify a user input is between a range but this error keeps appearing below it ' statement expected but function found', any ideas anyone? Many thanks function get_choice(var Options: integer): integer; var choice: integer; begin while (true) do begin write('choose option 1 to', Options); try readln(choice); if (choice>=1) and (choice <=Options) then get_choice := choice else write('invalid range'); except write('not a number'); end; end; 回答1: