9CBS code collection

xiaoxiao2021-03-06  41

Winexec ('net use //xxx.xxx.xxx.xxx psw / user: administrator', sw_hide); first log in to that machine then you can use "//" to access it.

SendMessage (Self.Handel, WM_Close, 0, 0); // Send a message to close the window

Your question should be that the form does not have free fall in the formclose event to write Action: = CAFREE;

How to let Edit can only enter Chinese procedure tform1.edit1Keypress (Sender: Tobject; var key: char); beginiff (key) <128 Then Key: = # 0; end; but to judge Delete and BackspaceProcedure TFORM1.EDIT1KEYPRESS Sender: TOBJECT; VAR Key: char); Begin IF (ORD (Key) <128) THEN IF (Key <> # 32) THEN Key: = # 0; END;

The text displayed in the EDIT component, how to make it among or right!

Right click on the control, there is a position property

Top Reply to: Luke5678 (Singular) () Reputation: 101 2004-9-23 10:23:56 Score: 0 Procedure TFORM1.FormCreate (Sender: TOBJECT); Begin SetWindowlong (Edit1.Handle, GWL_Style, getWindowlong (Edit1.Handle , Gwl_style) es_center); // hit Edit1.refresh;

Setwindowlong (edit2.handle, gwl_style, getwindowlong (edit2.handle, gwl_style) es_right); // hit Edit2.Refresh; end;

Var DefStyle: DWORD; Begin DefStyle: = getWindowlong (Edit1.Handle, GWL_Style); setWindowlong (edit1.handle, gwl_style, defstyle or es_right) end;

Top Reply to: lzy6204 (for forgetting memories) () Reputation: 101 2004-9-23 10:36:40 Score: 20 overload, write [转]: Install the following controls to your delphi - ------------------------------------- Unit Aedit;

Interface

Uses Windows, Sysutils, Messages, Classes, Graphics, Controls, Forms, Dialogs, Menus, Stdctrls, ExtCtrls

type TEoCEdit = class (TEdit) private {Private declarations} FAlignment: TAlignment; protected {Protected declarations} function GetAlignment: TAlignment; virtual; procedure SetAlignment (newValue: TAlignment); virtual; procedure CreateParams (var Params: TCreateParams); override; public {Public declarations} constructor Create (AOwner: TComponent); override; destructor Destroy; override; published {Published properties and events} property Alignment: TAlignment read getAlignment write setAlignment; {Published} end; {TEoCEdit} procedure Register;

IMPLEMENTATION

Function TeoCedit.getAlignment: Talignment; {ReturNs the value of data member falignment: = falignment; end; {getAlignment}

procedure TEoCEdit.SetAlignment (newValue: TAlignment); {Sets data member FAlignment to newValue.} begin if FAlignment <> newValue then begin FAlignment: = newValue; if not (csLoading in componentstate) then ReCreateWnd; end; end; {SetAlignment}

DESTRUCTOR TEECEDIT.DESTROY; begin inherited destroy; end; {design}

constructor TEoCEdit.Create (AOwner: TComponent); {Creates an object of type TEoCEdit, and initializes properties.} begin inherited Create (AOwner); {Initialize properties with default values:} FAlignment: = taLeftJustify; end; {Create}

procedure TEoCEdit.CreateParams (var Params: TCreateParams); const Alignments: array [TAlignment] of WORD = (ES_LEFT, ES_RIGHT, ES_CENTER); begin inherited CreateParams (Params); Params.Style: = Params.Style or Alignments [FAlignment]; END;

Procedure register; begin registercomponents ('Eoc', [TeoCedit]); end; {register}

end This line procedure TForm1.FormCreate (Sender: TObject);. begin SetWindowLong (Edit1.Handle, GWL_STYLE, GetWindowlong (Edit1.Handle, GWL_STYLE) ES_CENTER); // centered Edit1.Refresh; SetWindowLong (Edit2.Handle, GWL_Style, getWindowlong (Edit2.handle, GWL_Style) ES_RIGHT); // e;

// OpenDialog Usage method if OpenDialog1.execute1

Begin

s: = extractfilepath (OpenDialog1.FileName);

Edit3.Text: = s 'lklb.mdb';

END;

// The total number of memory is displayed, the memory is the usage rate Label2.caption: = formatfloat ('#, ### "kb"', mymemorystatus.dwtotalphys / 1024); label4.caption: = format ('% D %%', [ MyMemoryStatus.dwMemoryLoad]);

转载请注明原文地址:https://www.9cbs.com/read-75591.html

New Post(0)