当前位置:主页>销售管理软件> 列表

字体的显示问题? 找进销存网络版破解

库存管理软件版1楼: 如何让INPUTQUERY中显示的字体为''宋体'',大小为9

2楼: 把inputquery改成inputquery1。
use Consts;


function GetAveCharSize(Canvas: TCanvas): TPoint;
var
I: Integer;
Buffer: array[0..51] of Char;
begin
for I := 0 to 25 do Buffer[I] := Chr(I + Ord(''A''));
for I := 0 to 25 do Buffer[I + 26] := Chr(I + Ord(''a''));
GetTextExtentPoint(Canvas.Handle, Buffer, 52, TSize(Result));
Result.X := Result.X div 52;
end;

function InputQuery1(const ACaption, APrompt: string;
var Value: string): Boolean;
var
Form: TForm;
Prompt: TLabel;
Edit: TEdit;
DialogUnits: TPoint;
ButtonTop, ButtonWidth, ButtonHeight: Integer;
sFontName : string;
iFontSize : integer;
begin
sFontName := ''宋体'';
iFontSize := 12;

Result := False;
Form := TForm.Create(Application);
with Form do
try
Canvas.Font := Font;
Canvas.Font.Name := sFontName;
Canvas.Font.Size := iFontSize;



DialogUnits := GetAveCharSize(Canvas);
BorderStyle := bsDialog;
Caption := ACaption;
ClientWidth := MulDiv(180, DialogUnits.X, 4);
Position := poScreenCenter;
Prompt := TLabel.Create(Form);
with Prompt do
begin
Parent := Form;
Caption := APrompt;
Left := MulDiv(8, DialogUnits.X, 4);
Top := MulDiv(8, DialogUnits.Y, 8);
Constraints.MaxWidth := MulDiv(164, DialogUnits.X, 4);
WordWrap := True;
Font.Name := sFontName;
Font.Size := iFontSize;
end;
Edit := TEdit.Create(Form);
with Edit do
begin
Parent := Form;
Left := Prompt.Left;
Top := Prompt.Top + Prompt.Height + 5;
Width := MulDiv(164, DialogUnits.X, 4);
MaxLength := 255;
Text := Value;
SelectAll;
Font.Name := sFontName;
Font.Size := iFontSize;
end;
ButtonTop := Edit.Top + Edit.Height + 15;

ButtonWidth := MulDiv(50, DialogUnits.X, 4);
ButtonHeight := MulDiv(14, DialogUnits.Y, 8);
with TButton.Create(Form) do
begin
Parent := Form;
Caption := SMsgDlgOK;
ModalResult := mrOk;
Default := True;
SetBounds(MulDiv(38, DialogUnits.X, 4), ButtonTop, ButtonWidth,
ButtonHeight);
end;
with TButton.Create(Form) do
begin
Parent := Form;
Caption := SMsgDlgCancel;
ModalResult := mrCancel;
Cancel := True;
SetBounds(MulDiv(92, DialogUnits.X, 4), Edit.Top + Edit.Height + 15,
ButtonWidth, ButtonHeight);
Form.ClientHeight := Top + Height + 13;
end;
if ShowModal = mrOk then
begin
Value := Edit.Text;
Result := True;
end;
finally
Form.Free;
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
ss : string;
begin
ADOConnection1.Open;
ADOTable1.Open;
InputQuery1(''test'',''test it'',ss);
caption := ss;
end; 如进销存网络版破解

3楼: 可能要修改pas文件吧

4楼: inputquery属于哪个PAS文件?

5楼: 没注意,老兄,又是你哦
暴光一下
ymg1103 有: 73个待答问题, 1个已答问题, 回答了: 6 个问题。 富翁笔记

6楼: BS一下!

库存管理软件版7楼: //供MyInputQuery内部调用
function GetAveCharSize(Canvas: TCanvas): TPoint;
var
I: Integer;
Buffer: array[0..51] of Char;
begin
for I := 0 to 25 do Buffer[I] := Chr(I + Ord(''A''));
for I := 0 to 25 do Buffer[I + 26] := Chr(I + Ord(''a''));
GetTextExtentPoint(Canvas.Handle, Buffer, 52, TSize(Result));
Result.X := Result.X div 52;
end;

function MyInputQuery(const ACaption, APrompt: string;var Value: string): Boolean;
var
Form: TForm;
Prompt: TLabel;
Edit: TEdit;
DialogUnits: TPoint;
ButtonTop, ButtonWidth, ButtonHeight: Integer;


begin
Result := False;
Form := TForm.Create(Application);
with Form do
try
Canvas.Font := Font;
DialogUnits := GetAveCharSize(Canvas);
BorderStyle := bsDialog;
Caption := ACaption;
ClientWidth := MulDiv(180, DialogUnits.X, 4);
ClientHeight := MulDiv(63, DialogUnits.Y, 8);
Position := poScreenCenter;
Prompt := TLabel.Create(Form);
with Prompt do
begin
Parent := Form;
//ADD By Aiming
Font.Name := ''宋体'';
Font.Size := 9;
layout := tlCenter;
//change By Aiming
AutoSize := False;
Left := MulDiv(8, DialogUnits.X, 4);
Top := 0;
Width := Muldiv(180-2*8,DialogUnits.X,4);
Height := Muldiv(18,DialogUnits.Y,8); // _EDIT.Top := MulDiv(19, DialogUnits.Y, 8);
WordWrap := True;
{
AutoSize := True;
Top := MulDiv(8, DialogUnits.Y, 8);
Left := MulDiv(8, DialogUnits.X, 4);

}
Caption := APrompt;
end;
Edit := TEdit.Create(Form);
with Edit do
begin
Parent := Form;
Left := Prompt.Left;
Top := MulDiv(19, DialogUnits.Y, 8);
Width := MulDiv(164, DialogUnits.X, 4);
MaxLength := 255;
Text := Value;
SelectAll;
end;
ButtonTop := MulDiv(41, DialogUnits.Y, 8);
ButtonWidth := MulDiv(50, DialogUnits.X, 4);
ButtonHeight := MulDiv(14, DialogUnits.Y, 8);
with TButton.Create(Form) do
begin
Parent := Form;
//ADD By Aiming
Font.Name := ''宋体n'';
Font.Size := 9;
//Change by Aiming
Caption := ''确认'';
//Caption := SMsgDlgOK;
ModalResult := mrOk;
Default := True;
SetBounds(MulDiv(38, DialogUnits.X, 4), ButtonTop, ButtonWidth,
ButtonHeight);
end;
with TButton.Create(Form) do


begin
Parent := Form;
//ADD By Aiming
Font.Name := ''宋体'';
Font.Size := 9;
//Change by Aiming
Caption := ''放弃'';
//Caption := SMsgDlgCancel;
ModalResult := mrCancel;
Cancel := True;
SetBounds(MulDiv(92, DialogUnits.X, 4), ButtonTop, ButtonWidth,
ButtonHeight);
end;
if ShowModal = mrOk then
begin
Value := Edit.Text;
Result := True;
end;
finally
Form.Free;
end;
end;

8楼: 接受答案了.