[Solved] Delphi 7 Webbrowser – select without value [closed]

TWebBrowser is just a wrapper for the Internet Explorer ActiveX control, so this is really an IE DOM issue, not a Delphi issue. Try setting the select element’s selectedIndex property instead of its value property: WebBrowser1.OleObject.Document.All.Item(‘year’, 0).selectedIndex := 0; The value property is what gets transmitted to the server, but only of there is an … Read more

[Solved] Select Directory error … delphi 7 [closed]

var olddir: string; //global variable procedure olddiris(name:string); begin if name=”trick” then olddir:= ‘c:\program files\’+name; end; procedure MyGetPath(name:string); var options : TSelectDirOpts; begin OldDirIs(name); //returns olddir if FileCtrl.SelectDirectory(OldDir,options,0) then ShowMessage(‘i got it’); end; procedure TForm1.Button1Click(Sender: TObject); begin Mygetpath(‘trick’); end; This code runs without error… (Note: changed GetPath -> MyGetPath; added “\” to ‘c:\program files’) If the … Read more

[Solved] How to make custom sizing for window with non-sizeable borders?

Here a customized form-class with implemented non-sizeable borders sizing and possibility to disable sizing for specified edges. Also it supports double clicks on borders to toggle between two rectangle-boundaries: AutoSizeRect to values of which form sides getting moved on dblclick and SavedSizeRect into which values form side coordinates saved before changing. So AutoSizeRect could be … Read more

[Solved] Draw n random integers whose sum is equal to 100 [closed]

Using only integer numbers and Fisher-Yates shuffle: program cont3; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; const SummandsCount = 5; WantedSum = 100; var i, j, t, Cnt, WhereToInsert: integer; JustNaturalNumbers: array[1..WantedSum] of Integer; DividingPoints: array[0..SummandsCount] of Integer; begin Randomize; Cnt := 1; DividingPoints[0] := 0; DividingPoints[SummandsCount] := 100; for i := 1 to WantedSum – … Read more

[Solved] How to change the ClientRect of a form?

type TForm1 = class(TForm) .. private procedure WmNCCalcSize(var Msg: TWMNCCalcSize); message WM_NCCALCSIZE; .. .. procedure TForm1.WmNCCalcSize(var Msg: TWMNCCalcSize); begin inherited; if Msg.CalcValidRects then begin InflateRect(Msg.CalcSize_Params.rgrc[0], -10, -6); Msg.Result := 0; end; end; Please, carefully read WM_NCCALCSIZE‘s documentation though, including the remarks section and also NCCALCSIZE_PARAMS, as I’m not sure this is what you want. But … Read more