如何把DateTimePicker的边框去掉?不胜感激 我想把DateTimePicker的边框去掉,就像Edit一样,我试着在我继承的DateTimePicker控件中把Edit的设边框的代码加进去,属性是有了可没效果 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个基本上是没有办法解决的,因为它是系统画的,不过可这样来,系统画完后,我们再画上去覆盖它:unit MYDATETIMEPICKER;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls;type TMYDATETIMEPICKER = class(TDateTimePicker) private { Private declarations } procedure WMPaint(var Message: TWMPaint); message WM_PAINT; protected { Protected declarations } public { Public declarations } published { Published declarations } end;procedure Register;implementationprocedure Register;begin RegisterComponents('Standard', [TMYDATETIMEPICKER]);end;{ TMYDATETIMEPICKER }procedure TMYDATETIMEPICKER.WMPaint(var Message: TWMPaint);var BtnFaceBrush, WindowBrush: HBRUSH; dc : hdc; r : TRect;begin inherited; DC := GetWindowDC(Handle); try BtnFaceBrush := CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); WindowBrush := CreateSolidBrush(GetSysColor(COLOR_WINDOW)); try GetWindowRect(Handle, R); OffsetRect (R, -R.Left, -R.Top); FrameRect (DC, R, BtnFaceBrush); InflateRect (R, -1, -1); FrameRect (DC, R, BtnFaceBrush); InflateRect (R, -1, -1); FrameRect (DC, R, WindowBrush); finally DeleteObject (WindowBrush); DeleteObject (BtnFaceBrush); end; finally ReleaseDC(Handle, DC); end;end;end. 把DateTimePicker缩小成只有一个下拉箭头,在旁边加个EDIT,看起来就想DateTimePicker平面化了。 考虑用三方控件,比如RZDATETIMEPICKER就可以 >>我想把DateTimePicker的边框去掉,就像Edit一样,那你直接用個Edit 來顯示, 操作, 不行嗎??旁邊加個按鈕就行!! 大家数据库安全怎么做的 SQL循环联接记录问题 快速看透一个人! 关于com+的初级问题? 怎样将2006-06-27这种格式的日期转为6-27这种只显示月份和日期格式? 这个如何实现? dat文件以及播放时间? 在sql server里, 怎样查询在某一范围的日期值。 如何在窗体运行的时候动态创建控件? 请问如何发布带有第三方组件的软件,如report builder,需要什么额外工作? 把报表导成EXCEL、WORD、HTM的这个功能是自己做的,还是报表本身提供的??谁有这个的源码?谢谢了 如何使用函数GetDiskFreeSpaceEx获取磁盘剩余空间
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls;type
TMYDATETIMEPICKER = class(TDateTimePicker)
private
{ Private declarations }
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;procedure Register;implementationprocedure Register;
begin
RegisterComponents('Standard', [TMYDATETIMEPICKER]);
end;{ TMYDATETIMEPICKER }procedure TMYDATETIMEPICKER.WMPaint(var Message: TWMPaint);
var
BtnFaceBrush, WindowBrush: HBRUSH;
dc : hdc;
r : TRect;
begin
inherited;
DC := GetWindowDC(Handle);
try
BtnFaceBrush := CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
WindowBrush := CreateSolidBrush(GetSysColor(COLOR_WINDOW));
try
GetWindowRect(Handle, R);
OffsetRect (R, -R.Left, -R.Top);
FrameRect (DC, R, BtnFaceBrush);
InflateRect (R, -1, -1);
FrameRect (DC, R, BtnFaceBrush);
InflateRect (R, -1, -1);
FrameRect (DC, R, WindowBrush);
finally
DeleteObject (WindowBrush);
DeleteObject (BtnFaceBrush);
end;
finally
ReleaseDC(Handle, DC);
end;
end;end.
那你直接用個Edit 來顯示, 操作, 不行嗎??
旁邊加個按鈕就行!!