c++如何使控件 置顶?

smartjeck 2011-10-14 03:44:13
rt
...全文
690 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
buyong 2011-10-17
  • 打赏
  • 举报
回复
SetWindowPos
smartjeck 2011-10-17
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 likang0712 的回复:]

何为置顶?

你说控件叠加起来神马的?
[/Quote]

就是这个意思
宇影周邵 2011-10-15
  • 打赏
  • 举报
回复
SetFocus
请叫我涛哥0-0 2011-10-15
  • 打赏
  • 举报
回复
如果要置顶,给你个函数:

BOOL SetWindowPos( const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );

这个次懂了吗,看看吧


Remarks

Call this member function to change the size, position, and Z-order of child, pop-up, and top-level windows.

Windows are ordered on the screen according to their Z-order; the window at the top of the Z-order appears on top of all other windows in the order.


All coordinates for child windows are client coordinates (relative to the upper-left corner of the parent window’s client area).
cityboyloving 2011-10-15
  • 打赏
  • 举报
回复
你想要置顶到哪里?窗体的什么位置?
「已注销」 2011-10-14
  • 打赏
  • 举报
回复
何为置顶?

你说控件叠加起来神马的?

请叫我涛哥0-0 2011-10-14
  • 打赏
  • 举报
回复
如果支持MFC的话,我给你举个设置文本框文字长度的例子:

用到的函数有
CWnd* GetDlgItem( int nID ) const;//获取资源

void LimitText( int nChars = 0 );//限制文本框中文字的长度




CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);//IDC_EDIT1是空间ID
pBoxOne->LimitText(10) //文本框只能输入10个字符

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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