VC属性设置问题

controstr 2008-04-02 10:41:20
学弟刚学VC,用的是VS 2005,但在使用CListBox时有一个Sort的属性,不知道用代码如何设置

另外还有一个问题是在编写代码的过程中经常遇到在添加按钮事件时出现“CMobileDlg”无法编辑的现象,不知道这是为什么
...全文
94 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
scq2099yt 2008-04-12
  • 打赏
  • 举报
回复
ModifyStyle
List-Box Styles
LBS_EXTENDEDSEL The user can select multiple items using the SHIFT key and the mouse or special key combinations.


LBS_HASSTRINGS Specifies an owner-draw list box that contains items consisting of strings. The list box maintains the memory and pointers for the strings so the application can use the GetText member function to retrieve the text for a particular item.


LBS_MULTICOLUMN Specifies a multicolumn list box that is scrolled horizontally. The SetColumnWidth member function sets the width of the columns.


LBS_MULTIPLESEL String selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected.


LBS_NOINTEGRALHEIGHT The size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items.


LBS_NOREDRAW List-box display is not updated when changes are made. This style can be changed at any time by sending a WM_SETREDRAW message.


LBS_NOTIFY Parent window receives an input message whenever the user clicks or double-clicks a string.


LBS_OWNERDRAWFIXED The owner of the list box is responsible for drawing its contents; the items in the list box are the same height.


LBS_OWNERDRAWVARIABLE The owner of the list box is responsible for drawing its contents; the items in the list box are variable in height.


LBS_SORT Strings in the list box are sorted alphabetically.


LBS_STANDARD Strings in the list box are sorted alphabetically, and the parent window receives an input message whenever the user clicks or double-clicks a string. The list box contains borders on all sides.


LBS_USETABSTOPS Allows a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog units. (A dialog unit is a horizontal or vertical distance. One horizontal dialog unit is equal to one-fourth of the current dialog base width unit. The dialog base units are computed based on the height and width of the current system font. The GetDialogBaseUnits Windows function returns the current dialog base units in pixels.)


LBS_WANTKEYBOARDINPUT The owner of the list box receives WM_VKEYTOITEM or WM_CHARTOITEM messages whenever the user presses a key while the list box has input focus. This allows an application to perform special processing on the keyboard input.


LBS_DISABLENOSCROLL The list box shows a disabled vertical scroll bar when the list box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.
controstr 2008-04-11
  • 打赏
  • 举报
回复
好像不行
hurryboylqs 2008-04-02
  • 打赏
  • 举报
回复
ModifyStyle(0,LBS_SORT);

16,548

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • AIGC Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧