改原文件就可以了不过最好还是自己照着写一个<br>function TFrmZD.MyInputQuery(const ACaption, APrompt: string;<br> var Value: string): Boolean;<br> function MyGetAveCharSize(Canvas: TCanvas): TPoint;<br> var<br> I: Integer;<br> Buffer: array[0..51] of Char;<br> begin<br> for I := 0 to 25 do Buffer := Chr(I + Ord('A'));<br> for I := 0 to 25 do Buffer[I + 26] := Chr(I + Ord('a'));<br> GetTextExtentPoint(Canvas.Handle, Buffer, 52, TSize(Result));<br> Result.X := Result.X div 52;<br> end;<br>var<br> Form: TForm;<br> Prompt: TLabel;<br> Edit: TEdit;<br> DialogUnits: TPoint;<br> ButtonTop, ButtonWidth, ButtonHeight: Integer;<br>begin<br> Result := False;<br> Form := TForm.Create(Application);<br> with Form do<br> try<br> Font.Assign(FrmZD.Font);<br> Canvas.Font := Font;<br> DialogUnits := MyGetAveCharSize(Canvas);<br> BorderStyle := bsDialog;<br> Caption := ACaption;<br> ClientWidth := MulDiv(180, DialogUnits.X, 4);<br> ClientHeight := MulDiv(63, DialogUnits.Y, 8);<br> Position := poScreenCenter;<br> Prompt := TLabel.Create(Form);<br> with Prompt do<br> begin<br> Parent := Form;<br> AutoSize := True;<br> Left := MulDiv(8, DialogUnits.X, 4);<br> Top := MulDiv(8, DialogUnits.Y, 8);<br> Caption := APrompt;<br> end;<br> Edit := TEdit.Create(Form);<br> with Edit do<br> begin<br> Parent := Form;<br> Left := Prompt.Left;<br> Top := MulDiv(19, DialogUnits.Y, 8);<br> Width := MulDiv(164, DialogUnits.X, 4);<br> MaxLength := 255;<br> Text := Value;<br> SelectAll;<br> end;<br> ButtonTop := MulDiv(41, DialogUnits.Y, 8);<br> ButtonWidth := MulDiv(50, DialogUnits.X, 4);<br> ButtonHeight := MulDiv(14, DialogUnits.Y, 8);<br> with TButton.Create(Form) do<br> begin<br> Parent := Form;<br> Caption := '&Egrave;·&para;¨';<br> ModalResult := mrOk;<br> Default := True;<br> SetBounds(MulDiv(38, DialogUnits.X, 4), ButtonTop, ButtonWidth,<br> ButtonHeight);<br> end;<br> with TButton.Create(Form) do<br> begin<br> Parent := Form;<br> Caption := '&Egrave;&iexcl;&Iuml;&ucirc;';<br> ModalResult := mrCancel;<br> Cancel := True;<br> SetBounds(MulDiv(92, DialogUnits.X, 4), ButtonTop, ButtonWidth,<br> ButtonHeight);<br> end;<br> if ShowModal = mrOk then<br> begin<br> Value := Edit.Text;<br> Result := True;<br> end;<br> finally<br> Form.Free;<br> end;<br>end;<br><br>function TFrmZD.MyInputBox(const ACaption, APrompt, ADefault: string): string;<br>begin<br> Result := ADefault;<br> MyInputQuery(ACaption, APrompt, Result);<br>end;<br>用的时候直接用自己的函数就行了,和InputBox InputQuery一样的用法