⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aaaa.htm

📁 VC之改变控件的大小和位置 用CWnd类的函数MoveWindow()或SetWindowPos()可以改变控件的大小和位置。 void MoveWindow(int x,int y,int
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0050)http://blog.const.net.cn/item/b325b87b0f57b505.htm -->
<HTML><HEAD><TITLE>知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘</TITLE>
<META http-equiv=content-type content="text/html; charset=gb2312">
<META 
content="VC之改变控件的大小和位置&#13;&#10;用CWnd类的函数MoveWindow()或SetWindowPos()可以改变控件的大小和位置。&#13;&#10;&#13;&#10;voidMoveWindow(intx,inty,intnWid,知识库,VC之改变控件的大小和位置" 
name=description>
<META content=VC之改变控件的大小和位置 name=keywords ,知识库>
<META content=All name=Robots>
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
<META content=喝小酒的网摘,Heshouyong@Gmail.com name=Author>
<META content=http://Blog.Const.Net.Cn,喝小酒的网摘版权所有 name=Copyright>
<SCRIPT language=javascript 
src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/count.js" 
type=text/javascript>
</SCRIPT>

<SCRIPT language=javascript>
check();
</SCRIPT>
<LINK title=订阅喝小酒的网摘 href="http://blog.const.net.cn/xml/rss.xml" 
type=application/rss+xml rel=alternate><LINK 
href="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/blog.css" type=text/css 
rel=stylesheet><LINK 
href="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/blog1.css" type=text/css 
rel=stylesheet><LINK href="/favicon.gif" type=image/gif rel=icon><LINK 
href="http://blog.const.net.cn/favicon.gif" type=image/gif 
rel="shortcut icon"><LINK href="/favicon.gif" type=image/gif 
rel="SHORTCUT ICON"><LINK href="/favicon.gif" type=image/gif 
rel=BOOKMARK></HEAD>
<BODY onload=changeDiv();>
<CENTER>
<DIV id=main align=left>
<DIV id=header>
<DIV class=lc>
<DIV class=rc>
<DIV id=tab><A onclick=onclick_func(this) href="http://blog.const.net.cn/" 
target=_self>主页</A><SPAN>|</SPAN><A 
href="http://blog.const.net.cn/news">聚合新闻</A><A 
href="http://nba.const.net.cn/">NBA</A></DIV></DIV></DIV>
<DIV class=tit><A class=titlink title=喝小酒的网摘 onclick=onclick_func(this) 
href="http://blog.const.net.cn/">喝小酒的网摘</A></DIV>
<DIV class=desc>出师未捷身先死,长使英雄泪沾襟 喝小酒,的网摘 </DIV>
<DIV id=tabline></DIV></DIV>
<DIV class=stage>
<TABLE id=layout cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=c2t1 vAlign=top>
      <DIV class=mod id=mod_bloglist rel="drag">
      <TABLE class=modth cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD class=modtl width=7>&nbsp;</TD>
          <TD class=modtc noWrap>
            <DIV class=modhead><SPAN class=modtit>查看文章</SPAN></DIV>
            <SCRIPT language=javascript 
            src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/title.js"></SCRIPT>
          </TD>
          <TD class=modtc noWrap align=right></TD>
          <TD class=modtr width=7>&nbsp;</TD></TR></TBODY></TABLE>
      <DIV class=modbox id=m_blog>
      <DIV class=tit><BR><A onclick=onclick_func(this) 
      href="http://blog.const.net.cn/item/b325b87b0f57b505.htm" 
      target=_blank><FONT color=#4a7ff8>
      <H2>VC之改变控件的大小和位置</H2></FONT></A></DIV>
      <DIV class=date>2008-1-3 14:51:55</DIV>
      <TABLE style="TABLE-LAYOUT: fixed">
        <TBODY>
        <TR>
          <TD>
            <DIV class=cnt>
            <DIV style="DISPLAY: none">本文永久链接:<A onclick=onclick_func(this) 
            href="http://blog.const.net.cn/item/b325b87b0f57b505.htm" 
            target=_blank>VC之改变控件的大小和位置</A></DIV>
            <DIV class=ggad-content>
            <SCRIPT language=JavaScript 
            src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/css.js" 
            type=text/javascript></SCRIPT>
            </DIV><SPAN id=url1 
            style="DISPLAY: none">http://blog.const.net.cn/item/b325b87b0f57b505.htm</SPAN> 
            VC之改变控件的大小和位置<BR>用CWnd类的函数MoveWindow()或SetWindowPos()可以改变控件的大小和位置。<BR><BR>void 
            MoveWindow(int x,int y,int nWidth,int nHeight);<BR>void 
            MoveWindow(LPCRECT 
            lpRect);<BR>第一种用法需给出控件新的坐标和宽度、高度;<BR>第二种用法给出存放位置的CRect对象;<BR>例:<BR>CWnd 
            *pWnd;<BR>pWnd = GetDlgItem( IDC_EDIT1 );&nbsp;&nbsp;&nbsp;&nbsp; 
            //获取控件指针,IDC_EDIT1为控件ID号<BR>pWnd-&gt;MoveWindow( CRect(0,0,100,100) 
            );&nbsp;&nbsp;&nbsp;&nbsp; 
            //在窗口左上角显示一个宽100、高100的编辑控件<BR><BR>SetWindowPos()函数使用更灵活,多用于只修改控件位置而大小不变或只修改大小而位置不变的情况:<BR>BOOL 
            SetWindowPos(const CWnd* pWndInsertAfter,int x,int y,int cx,int 
            cy,UINT 
            nFlags);<BR>第一个参数我不会用,一般设为NULL;<BR>x、y控件位置;cx、cy控件宽度和高度;<BR>nFlags常用取值:<BR>SWP_NOZORDER:忽略第一个参数;<BR>SWP_NOMOVE:忽略x、y,维持位置不变;<BR>SWP_NOSIZE:忽略cx、cy,维持大小不变;<BR>例:<BR>CWnd 
            *pWnd;<BR>pWnd = GetDlgItem( IDC_BUTTON1 );&nbsp;&nbsp;&nbsp;&nbsp; 
            //获取控件指针,IDC_BUTTON1为控件ID号<BR>pWnd-&gt;SetWindowPos( 
            NULL,50,80,0,0,SWP_NOZORDER | SWP_NOSIZE );&nbsp;&nbsp;&nbsp;&nbsp; 
            //把按钮移到窗口的(50,80)处<BR>pWnd = GetDlgItem( IDC_EDIT1 
            );<BR>pWnd-&gt;SetWindowPos( NULL,0,0,100,80,SWP_NOZORDER | 
            SWP_NOMOVE );&nbsp;&nbsp;&nbsp;&nbsp; 
            //把编辑控件的大小设为(100,80),位置不变<BR>pWnd = GetDlgItem( IDC_EDIT1 
            );<BR>pWnd-&gt;SetWindowPos( NULL,0,0,100,80,SWP_NOZORDER 
            );&nbsp;&nbsp;&nbsp;&nbsp; 
            //编辑控件的大小和位置都改变<BR>以上方法也适用于各种窗口。<BR>[Blog.Const.Net.Cn]
            <HR>
            <SPAN id=url style="DISPLAY: none">BLOG.CONST.NET.CN/喝小酒的网摘</SPAN> 
            <DIV id=copylink align=center><LABEL><INPUT class=copyUrl onclick="CopyInBoard('我在喝小酒的网摘上看到一篇不错的文章VC之改变控件的大小和位置   http://Blog.Const.Net.Cn/Item/b325b87b0f57b505.htm,祝你天天好心情!  *^_^*');" type=button value=复制标题和链接,发送给你的QQ,MSN好友 name=button></LABEL> 
            </DIV>
            <DIV>本文链接:<A onclick=onclick_func(this) 
            href="http://blog.const.net.cn/item/b325b87b0f57b505.htm" 
            target=_blank>VC之改变控件的大小和位置</A></DIV></DIV></TD></TR></TBODY></TABLE>
      <DIV id=sitemap align=center>
      <DIV class=line></DIV>
      <H3><A onclick=onclick_func(this) 
      href="http://blog.const.net.cn/item/a8db9b618592a86a.htm" 
      target=_self><FONT color=red>上一篇:</FONT> VC之控件的隐藏与显示</A>&nbsp;&nbsp;&nbsp; 
      <A onclick=onclick_func(this) 
      href="http://blog.const.net.cn/category/list.asp?kind=知识库" 
      target=_self>知识库的目录</A>&nbsp;&nbsp;&nbsp; <A onclick=onclick_func(this) 
      href="http://blog.const.net.cn/item/60aa46c61a577790.htm" 
      target=_self><FONT color=red>下一篇:</FONT>VC之设定view中控件的初始尺寸</A> </H3>
      <SCRIPT language=JavaScript 
      src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/google.js" 
      type=text/javascript></SCRIPT>
      </DIV>
      <DIV class=line></DIV>
      <DIV class=opt><A title=查看该分类中所有文章 onclick=onclick_func(this) 
      href="http://blog.const.net.cn/category/知识库" target=_blank>类别:知识库</A>|<A 
      title=查看该分类中所有文章 onclick=onclick_func(this) 
      href="http://blog.const.net.cn/category/知识库" target=_blank>浏览(<SPAN 
      id=hits>4</SPAN>)</A> </DIV>
      <DIV class=line></DIV>
      <DIV id=divComment style="DISPLAY: none"></DIV>
      <DIV id=about>
      <TABLE width="100%" border=0>
        <TBODY>
        <TR>
          <TD>
            <DIV class=gg-ttt>
            <SCRIPT language=JavaScript 
            src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/T.js" 
            type=text/javascript></SCRIPT>
            </DIV>更多关于<A href="http://blog.const.net.cn/category/知识库" a> 知识库</A> 
            内容<BR><SPAN id=linkArea><A title="知识库 VC之改变控件的大小和位置" 
            href="http://blog.const.net.cn/item/b325b87b0f57b505.htm">知识库 
            VC之改变控件的大小和位置</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 VC之控件的隐藏与显示" 
            href="http://blog.const.net.cn/item/a8db9b618592a86a.htm">知识库 
            VC之控件的隐藏与显示</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 VC之按钮的使能与禁止" 
            href="http://blog.const.net.cn/item/fec5b4477f760ca0.htm">知识库 
            VC之按钮的使能与禁止</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 CSS的常用技巧" 
            href="http://blog.const.net.cn/item/8d877c3949760a94.htm">知识库 
            CSS的常用技巧</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title='知识库 vc中ado操作时提示"类型不匹配"' 
            href="http://blog.const.net.cn/item/187cf3d52ea86538.htm">知识库 
            vc中ado操作时提示"类型不匹配"</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 Google,Chart" 
            href="http://blog.const.net.cn/item/20186400c494db70.htm">知识库 
            Google,Chart</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 触发器知识小记" 
            href="http://blog.const.net.cn/item/3507cfc25d20fe7f.htm">知识库 
            触发器知识小记</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 VC从工程中删除一个类" 
            href="http://blog.const.net.cn/item/7adfd8a04ac1f115.htm">知识库 
            VC从工程中删除一个类</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 vc中让CListCtrl出现表格状的边框" 
            href="http://blog.const.net.cn/item/8a930b56e7d71ec5.htm">知识库 
            vc中让CListCtrl出现表格状的边框</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN 
            id=linkArea><A title="知识库 VC_窗口最大化时使listctrl控件也扩大" 
            href="http://blog.const.net.cn/item/2eb4f0d8c55ecc7b.htm">知识库 
            VC_窗口最大化时使listctrl控件也扩大</A></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></TD>
          <TD>
            <DIV id=pl>
            <P class=posttop><A name=comment>发表评论:</A></P>
            <FORM id=frmSumbit 
            action=http://blog.const.net.cn/comment/index.asp?action=add 
            method=post target=_self><INPUT id=inpId type=hidden 
            value=b325b87b0f57b505 name=inpId><INPUT id=inpArticle type=hidden 
            value=5872c98ac16e6009 name=inpArticle><INPUT id=inpLocation 
            type=hidden name=inpLocation>
            <P><INPUT id=frmName tabIndex=1 size=28 name=frmName> <LABEL 
            for=frmName>名称(*)</LABEL></P>
            <P><INPUT id=frmEmail tabIndex=2 size=28 name=frmEmail> <LABEL 
            for=frmEmail>邮箱</LABEL></P>
            <P><INPUT id=frmUrl tabIndex=3 size=28 value=http:// name=frmUrl> 
            <LABEL for=frmUrl>网站链接</LABEL></P>
            <P><INPUT id=frmVerify tabIndex=3 type=hidden size=28 
            name=frmVerify></P>
            <P><LABEL for=frmContent>正文(*)(留言最长字数:800)</LABEL></P>
            <P><TEXTAREA id=content tabIndex=5 name=content rows=4 cols=50></TEXTAREA></P>
            <P><INPUT onclick="return Submit(getTitle());" tabIndex=6 type=button value=提交 name=btnSumbit></P></FORM></DIV></TD></TR></TBODY></TABLE></DIV>
      <DIV class=line></DIV>
      <DIV class=tit></DIV></DIV>
      <TABLE height=8 cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD class=modbl width=7>&nbsp;</TD>
          <TD class=modbc>&nbsp;</TD>
          <TD class=modbr width=7>&nbsp;</TD></TR></TBODY></TABLE></DIV></TD>
    <TD class=c2t3 vAlign=top>
      <SCRIPT src="知识库 VC之改变控件的大小和位置 -出师未捷身先死,长使英雄泪沾襟 - 喝小酒的网摘.files/sq.js" 
      type=text/javascript>
</SCRIPT>
      <SPAN 
id=showImport></SPAN></TD></TR></TBODY></TABLE><!---class="stage" ---></DIV><!---id="main" ---></DIV><BR><BR></CENTER>
<DIV class=footer style="FONT-SIZE: 12px" align=center>2008 CONST<A 
href="http://blog.const.net.cn/">喝</A><A 
href="http://blog.const.net.cn/">小</A><A href="http://blog.const.net.cn/">酒</A> 
Supported by <A href="http://blog.const.net.cn/">Blog.Const.Net.Cn</A> &nbsp; <A 
style="COLOR: rgb(51,51,51)" 
href="http://www.miibeian.gov.cn/">粤ICP备07066574号</A></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -