CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

edit控件

楼主Rayanywhere()2002-11-25 12:55:45 在 VC/MFC / 基础类 提问

怎么让光标移动到指定位置 问题点数:60、回复次数:9Top

1 楼lzd(活着便精彩)回复于 2002-11-25 12:59:39 得分 5

GetDlgItem(IDC_XXX)->SetFocus();Top

2 楼zhaolaoxin()回复于 2002-11-25 13:00:43 得分 10

m_edit.SetSel()  
  Top

3 楼kingcom_xu(冷羽)回复于 2002-11-25 13:06:45 得分 20

m_edit1.SetFocus();  
  m_edit1.SetWindowText("aaaaaaaaaaaaaa");  
  m_edit1.SetSel(2,2);Top

4 楼Saimen(沉默是金)回复于 2002-11-25 13:08:52 得分 0

yesTop

5 楼Rayanywhere()回复于 2002-11-25 14:00:54 得分 0

谢了  给分!Top

6 楼Rayanywhere()回复于 2002-11-25 14:14:21 得分 0

顺便问一下,要移动到最后该怎么得到他的positionTop

7 楼Rayanywhere()回复于 2002-11-25 14:15:43 得分 0

顺便问一下,要移动到最后该怎么得到他的positionTop

8 楼kingcom_xu(冷羽)回复于 2002-11-25 14:33:39 得分 15

m_edit1.SetWindowText("bbbbb");  
  m_edit1.SetFocus();  
  CString   str;  
  m_edit1.GetWindowText(str);  
  m_edit1.SetSel(str.GetLength(),str.GetLength());Top

9 楼Saimen(沉默是金)回复于 2002-11-25 14:34:55 得分 10

//移动编辑窗口光标到最后  
  void   CDockPadDlg::MoveEditCurToEnd()  
  {  
  UINT   nBufLength;  
  nBufLength   =   m_strEditText.GetLength();  
  m_editCtrl.SetSel(nBufLength,nBufLength,FALSE);  
  }  
   
   
  CEdit::GetSel    
  DWORD   GetSel(   )   const;  
   
  void   GetSel(   int&   nStartChar,   int&   nEndChar   )   const;  
   
  Return   Value  
   
  The   version   that   returns   a   DWORD   returns   a   value   that   contains   the   starting   position   in   the   low-order   word   and   the   position   of   the   first   nonselected   character   after   the   end   of   the   selection   in   the   high-order   word.  
   
  Parameters  
   
  nStartChar  
   
  Reference   to   an   integer   that   will   receive   the   position   of   the   first   character   in   the   current   selection.  
   
  nEndChar  
   
  Reference   to   an   integer   that   will   receive   the   position   of   the   first   nonselected   character   past   the   end   of   the   current   selection.  
   
  Remarks  
   
  Call   this   function   to   get   the   starting   and   ending   character   positions   of   the   current   selection   (if   any)   in   an   edit   control,   using   either   the   return   value   or   the   parameters.  
   
  For   more   information,   seeEM_GETSEL   in   the   Win32   documentation  
  Top

相关问题

  • 控件!!!
  • 控件
  • 控件
  • 控件
  • CStatic控件和CEdit控件
  • 制作控件
  • 急寻控件
  • 找 menutoolbar 控件
  • Rx控件
  • 控件问题

关键词

  • 移动
  • nbuflength
  • edit1
  • getsel
  • setsel
  • setfocus
  • getlength
  • position
  • str

得分解答快速导航

  • 帖主:Rayanywhere
  • lzd
  • zhaolaoxin
  • kingcom_xu
  • kingcom_xu
  • Saimen

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo