社区
Delphi
帖子详情
找控件
武稀松
2002-02-05 11:27:42
sncCurrencyEdit控件那里有?
给个链接或发到我的信箱wr_960204@x263.net
...全文
64
4
打赏
收藏
找控件
sncCurrencyEdit控件那里有? 给个链接或发到我的信箱wr_960204@x263.net
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
wave_calmly
2002-02-06
打赏
举报
回复
http://202.96.70.228/cakk/delphi/
武稀松
2002-02-06
打赏
举报
回复
呵呵,这是你自己写的吧。我要的不是这个!
torble
2002-02-05
打赏
举报
回复
Source Code for TCurrencyEdit
Unit CurrEdit;
Interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Menus, Forms, Dialogs, StdCtrls;
type
TCurrencyEdit = class(TCustomMemo)
private
DispFormat: string;
FieldValue: Extended;
procedure SetFormat(A: string);
procedure SetFieldValue(A: Extended);
procedure CMEnter(var Message: TCMEnter); message CM_ENTER;
procedure CMExit(var Message: TCMExit); message CM_EXIT;
procedure FormatText;
procedure UnFormatText;
protected
procedure KeyPress(var Key: Char); override;
procedure CreateParams(var Params: TCreateParams); override;
public
constructor Create(AOwner: TComponent); override;
published
property Alignment default taRightJustify;
property AutoSize default True;
property BorderStyle;
property Color;
property Ctl3D;
property DisplayFormat: string read DispFormat write SetFormat;
property DragCursor;
property DragMode;
property Enabled;
property Font;
property HideSelection;
property MaxLength;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ReadOnly;
property ShowHint;
property TabOrder;
property Value: Extended read FieldValue write SetFieldValue;
property Visible;
property OnChange;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Additional', [TCurrencyEdit]);
end;
constructor TCurrencyEdit.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
AutoSize := True;
Alignment := taRightJustify;
Width := 121;
Height := 25;
DispFormat := '$,0.00;($,0.00)';
FieldValue := 0.0;
AutoSelect := False;
WantReturns := False;
WordWrap := False;
FormatText;
end;
procedure TCurrencyEdit.SetFormat(A: String);
begin
if DispFormat <> A then
begin
DispFormat:= A;
FormatText;
end;
end;
procedure TCurrencyEdit.SetFieldValue(A: Extended);
begin
if FieldValue <> A then
begin
FieldValue := A;
FormatText;
end;
end;
procedure TCurrencyEdit.UnFormatText;
var
TmpText : String;
Tmp : Byte;
IsNeg : Boolean;
begin
IsNeg := (Pos('-',Text) > 0) or (Pos('(',Text) > 0);
TmpText := '';
For Tmp := 1 to Length(Text) do
if Text[Tmp] in ['0'..'9','.'] then
TmpText := TmpText + Text[Tmp];
try
FieldValue := StrToFloat(TmpText);
if IsNeg then FieldValue := -FieldValue;
except
MessageBeep(mb_IconAsterisk);
end;
end;
procedure TCurrencyEdit.FormatText;
begin
Text := FormatFloat(DispFormat,FieldValue);
end;
procedure TCurrencyEdit.CMEnter(var Message: TCMEnter);
begin
SelectAll;
inherited;
end;
procedure TCurrencyEdit.CMExit(var Message: TCMExit);
begin
UnformatText;
FormatText;
Inherited;
end;
procedure TCurrencyEdit.KeyPress(var Key: Char);
begin
if Not (Key in ['0'..'9','.','-']) Then Key := #0;
inherited KeyPress(Key);
end;
procedure TCurrencyEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
case Alignment of
taLeftJustify : Params.Style := Params.Style or ES_LEFT and Not ES_MULTILINE;
taRightJustify : Params.Style := Params.Style or ES_RIGHT and Not ES_MULTILINE;
taCenter : Params.Style := Params.Style or ES_CENTER and Not ES_MULTILINE;
end;
end;
End.
武稀松
2002-02-05
打赏
举报
回复
没人用过吗?
windows Media Player
控件
类
windows Media Player
控件
类,主要为在VS中
找
不到ActiveX
控件
里的windows Media Player
控件
类所提供,里面有24类,版本较新.方法介绍:http://blog.csdn.net/akof1314/archive/2009/11/29/4900244.aspx
WPF分页DataGrid
最近用到WPF的表格
控件
,需要使用分页功能,
找
了很多例子都不是很满意。有些是模仿SL做的DataPager导航条,使用的时候还要和DataGrid组合使用,不是很方便。最好还是继承DataGrid的分页表格
控件
。 于是自己动手封装...
kotlin如何
找
控件
id
我们不需要使用findViewById来获取
控件
,只需要使用
控件
的id就可以操作
控件
的相关方法。当然大家也发现了import,没错,这也是必须的,AndroidStudio会自动为你添加。如果你不嫌麻烦,手动写也是没毛病的。 import...
AUTOJS】9.0去限制
找
控件
这里写自定义目录标题 最近公司有做脚本需求,网上查阅了一些资料做个记录 最近公司有做脚本需求,网上查阅了一些资料做个记录 开始适用7.0的版本,用着挺好,但是更新到9.0之后,一些APP的
控件
就被限制掉,
找
不到了...
WPF:通过名字
找
控件
var plotBorder = (Border)FindName(string.Format("PlotBorder{0}", i))
Delphi
5,928
社区成员
262,931
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章