📄 subject_51032.htm
字号:
<p>
序号:51032 发表者:鹏程 发表日期:2003-08-28 15:23:02
<br>主题:VC好难用呀!请教,谢谢
<br>内容:尽管我在登陆框Login中使用了SetFoucs()函数,但,登陆框Login启动后,编辑框EditName中仍然没有光标。那么怎样设置光标呢?还有怎样将光标从用户名框转移到密码框?<BR><BR>代码如下:<BR>BOOL CDialogAppApp::InitInstance()<BR>{<BR> AfxEnableControlContainer();<BR><BR> // Standard initialization<BR> // If you are not using these features and wish to reduce the size<BR> // of your final executable, you should remove from the following<BR> // the specific initialization routines you do not need.<BR><BR> // Change the registry key under which our settings are stored.<BR> // TODO: You should modify this string to be something appropriate<BR> // such as the name of your company or organization.<BR> SetRegistryKey(_T("Local AppWizard-Generated Applications"));<BR><BR> LoadStdProfileSettings(); // Load standard INI file options (including MRU)<BR><BR> // Register the application's document templates. Document templates<BR> // serve as the connection between documents, frame windows and views.<BR><BR>/////////////////////////////////////////////////////////////////////<BR> CLogin login; //声明登录框对象<BR><BR> if(login.DoModal()==IDOK)<BR> {<BR> if(login.m_name!="zbz"||login.m_pass!="87983000")//验证密码 <BR> {<BR> return FALSE; //用户名或密码错误<BR> }<BR> }<BR> else<BR> {<BR> <BR> return FALSE; //取消登录<BR> }<BR>/////////////////////////////////////////////////////////////////////<BR><BR> CSingleDocTemplate* pDocTemplate;<BR> pDocTemplate = new CSingleDocTemplate(<BR> IDR_MAINFRAME,<BR> RUNTIME_CLASS(CDialogAppDoc),<BR> RUNTIME_CLASS(CMainFrame), // main SDI frame window<BR> RUNTIME_CLASS(CDialogAppView));<BR> AddDocTemplate(pDocTemplate);<BR><BR> // Parse command line for standard shell commands, DDE, file open<BR> CCommandLineInfo cmdInfo;<BR> ParseCommandLine(cmdInfo);<BR><BR> // Dispatch commands specified on the command line<BR> if (!ProcessShellCommand(cmdInfo))<BR> return FALSE;<BR><BR> // The one and only window has been initialized, so show and update it.<BR> m_pMainWnd->ShowWindow(SW_SHOW);<BR> m_pMainWnd->UpdateWindow();<BR><BR> return TRUE;<BR><BR>}
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:爱丽思 回复日期:2003-08-28 15:26:52
<br>内容:<BR>是焦点顺序不对<BR><BR>重新设置一下TAB ORDER,把edit放在第一个顺序上<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:鹏程 回复日期:2003-08-28 15:51:44
<br>内容:谢谢。<BR>我重新设置了TAB ORDER,登陆框Login启动后,编辑框EditName中已经有光标了,但是怎样将光标从用户名框转移到密码框?能通过编写代码实现吗?还请赐教,谢谢了。<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:爱丽思 回复日期:2003-08-28 16:04:33
<br>内容:这样太麻烦了,还是算了吧<BR>调用SetFocus好了
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:鹏程 回复日期:2003-08-28 18:20:01
<br>内容:xiexie .
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -