?
快捷搜索:  as  test  1111  test aNd 8=8  test++aNd+8=8  as++aNd+8=8  as aNd 8=8

正宗长沙麻将:1bet亦博官网娱乐:完成自编辑地Date Picker控件

?

长沙转转麻将必胜口诀 www.fv7j.com.cn 运行情况:VC7, VC6, XP, W2K, Win9X, Win95, NT4, MFC

简介

我想要这样一个控件,既包括标准date picker控件的功能,又能让用户任何时刻都能自己输入日期。标准的date picker控件有其自己的实现自编辑日期的措施,然则这并没有达到我想要的。

文档

此控件基于微软的CDateTimeCtrl类,我应用了一些小技术用我自己的编辑控件和按钮调换了标准的控件,然则处置惩罚类仍承袭于CDateTimeCtrl。为了实现这个功能,我销毁了已存在的窗口,并且创建了一个与类相关联的我自己的窗口。事情道理参看CDateTimeEditCtrl::OnRecreate。

基于我的实现措施,这个控件的应用与标准的CDateTimeCtrl完全一样。在你的对话框资本中加入一个标准的Date picker控件,然后为其创建CDateTimeEditC1bet亦博官网娱乐trl类型的成员变量。

这个控件支持平日的Date picker风格,下面几个风格不支持:DTS_UPDOWN, DTS_SHOWNONE, DTS_APPCANPARSE, DTS_LONGDATEFORMAT, and DTS_TIMEFORMAT。

消息通报与标准控件一样,然则不支持DTM_GETRANGE, DTM_SETRANGE和DTM_SETFORMAT消息??丶惺鹿实目椿び氡曜伎丶谎?,发送给父窗口。

一些额外的公有函数也被加入以供给更强的功能扩展,这些公有函数列表如下:

BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);

与CDateTimeCtrl功能类似.

CEdit* GetEditControl() const;

返回一个指向编辑控件的指针,经由过程这个指针可以直接处置惩罚它的属性。

void EnableButton(BOOL bEnable = TRUE);

容许或禁止用来下拉calendar control的按钮

void RestoreFocus(BOOL bRestore = TRUE);

Determines the behav1bet亦博官网娱乐iour when clicking on the button. If TRUE then the control re-sets the focus back to the window whitch had the focus on clicking the button, else the focus is set to the edit control. If the control is not editable focus is always set back to the previously focused window. The default is for the focus to be set to the edit control.

void SetNonEditable(BOOL bNonEditable = TRUE);

Used to make the edit portion of the control non-editable. The default is editable.

BOOL GetNonEditable();

Returns whether the edit control is currently editable.

virtual BOOL 1bet亦博官网娱乐IsValidDate(LPCTSTR lpszDate = NULL);

Returns whether the date string passed is valid. If lpszDate is NULL then it returns whether the text in the edit control is a valid date string.

void SetValidCharsOnly(BOOL bValidCharsOnly = TRUE);

Sets whether the user can only enter characters that are valid

BOOL GetValidCharsOnly();

Returns whether the user can only enter valid characters into the edit control

void SetValidChars(LPCTSTR lpszValidChars = NULL);

Sets the characters that are valid for the user to type into the edit con1bet亦博官网娱乐trol. If NULL is specified, then the default characters are used (0-9 and the current user\'s locale\'s date separator). If the user changes the locale settings then the control will detect this and use the new separator.

CString GetValidChars();

Returns the characters that have been set as being v1bet亦博官网娱乐alid for the user to type into the edit control

void SetAllowUpDownKeys(BOOL bAllow = TRUE);

Sets whether the up/down arrow keys will increment/decrement the part of the date string that contains the cursor.

BOOL GetAllowUpDownKeys();

Returns whether the up/down keys will increment/decrement parts of the date string.

免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。

您可能还会对下面的文章感兴趣: