请问有没有这样一个函数``可以实现将控件从某一坐标移动另一坐标?

fdsafas354 2005-04-03 04:05:16
请问有没有这样一个函数``可以实现将控件从某一坐标移动另一坐标?最起码要沿直线移动`并且可以控件速度```
...全文
108 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
bluestone 2005-06-09
  • 打赏
  • 举报
回复
SetWindowsPos或者MoveWindow,控件也是窗体。
kyh1234567 2005-06-09
  • 打赏
  • 举报
回复
没有专门的函数实现这个功能,只能像楼上所说的那样,加一个定时器控制,不停地MoveWindow(或者SetWinowPos),实现动画效果
^_^
muziling 2005-04-15
  • 打赏
  • 举报
回复
LPCRECT lpRect;
CRect rect;
CWnd *m_cWnd=GetDlgItem(IDC_STATIC);
lpRect=(LPCRECT)▭
rect.left=rect.left-10;
m_cWnd->GetWindowRect(&rect);
m_cWnd->MoveWindow(lpRect,TRUE);
这样一移,控件就消失了,……
dfyang 2005-04-03
  • 打赏
  • 举报
回复
不错
kugou123 2005-04-03
  • 打赏
  • 举报
回复
取得控件句柄,用MoveWindow就可以了。
fanqing 2005-04-03
  • 打赏
  • 举报
回复


MoveWindow(或者SetWinowPos)
xuzheng318 2005-04-03
  • 打赏
  • 举报
回复
This function changes the position and dimensions of the specified window. For a top-level window, the position and dimensions are relative to the upper-left corner of the screen. For a child window, they are relative to the upper-left corner of the parent window’s client area.

BOOL MoveWindow(
HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
BOOL bRepaint );





This function changes the size, position, and z-order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the z-order.

BOOL SetWindowPos(
HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags );
fdsafas354 2005-04-03
  • 打赏
  • 举报
回复
只有这样了``
Featured 2005-04-03
  • 打赏
  • 举报
回复
定时器控制,不停地MoveWindow(或者SetWinowPos),实现动画效果
fdsafas354 2005-04-03
  • 打赏
  • 举报
回复
UP
fdsafas354 2005-04-03
  • 打赏
  • 举报
回复
是的``要看到他的移动动作```有没有直接的就可以调用的``
cut9 2005-04-03
  • 打赏
  • 举报
回复
我理解你是要控件移动的时候,你能看到它的移动动作?对吗?
如果单是改变位子,MoveWindow, SetWindowPos就行了。

16,551

社区成员

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

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

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