如何动态改变静态文本框的大小? 程序运行时得到了一幅图像的大小,然后需要把静态文本框设置为这幅图像的大小,如何设置静态文本框的大小?希望设置的宽和高long m_nWidth;long m_nHeight;m_VideoWnd 为静态文本框对应的变量 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 m_VideoWnd.MoveWindow();void MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );void MoveWindow( LPCRECT lpRect, BOOL bRepaint = TRUE ); MoveWindow()SetWindowPos() CRect rect;m_VideoWnd.GetWindowRect(&rect);ScreenToClient (&rect);rect.bottom = rect.top + m_nHeight;rect.right = rect.left + m_nWidth;m_VideoWnd.MoveWindow( rect ); 为什么调用了m_VideoWnd.MoveWindow( rect )后静态文本框就消失了 CRect rect;m_VideoWnd.GetWindowRect(&rect);ScreenToClient (&rect);//用了这句吗?前无m_VideoWnd.rect.bottom = rect.top + m_nHeight;rect.right = rect.left + m_nWidth;m_VideoWnd.MoveWindow( rect ); long m_nWidth;long m_nHeight;m_VideoWnd 为静态文本框对应的变量if(m_VideoWnd.GetSafeWnd()){ MoveWindow(m_nWidth,m_nheight);}用加坐标转换吗?不用吧 用了ScreenToClient (&rect);就是按照你上面写的 使用上面的代码时你的m_nHeight与m_nWidth的值各是多少?不会是0吧? 是我得到的m_nHeight与m_nWidth的值有问题,谢谢hnyyy等 谢谢 hnyyy(前进) ( ) 信誉:111 受益。 [help]IE调用进程外组件的连接点问题 接收byte数组的问题,在线等 MFC socket StarServer 怎样可以创建多个客户端 多线程TCP通信的问题? 招个VC程序员真难 clistbox问题 可见问题 怎样实现这样的Scroll效果 寻求熟悉p2p通讯的vc程序员 ado sqlserver 问题 关于结构体MSG button怎么设置caption字体和大小
void MoveWindow( int x, int y, int nWidth, int nHeight, BOOL bRepaint = TRUE );void MoveWindow( LPCRECT lpRect, BOOL bRepaint = TRUE );
SetWindowPos()
m_VideoWnd.GetWindowRect(&rect);
ScreenToClient (&rect);
rect.bottom = rect.top + m_nHeight;
rect.right = rect.left + m_nWidth;
m_VideoWnd.MoveWindow( rect );
m_VideoWnd.GetWindowRect(&rect);ScreenToClient (&rect);//用了这句吗?前无m_VideoWnd.rect.bottom = rect.top + m_nHeight;
rect.right = rect.left + m_nWidth;
m_VideoWnd.MoveWindow( rect );
long m_nHeight;
m_VideoWnd 为静态文本框对应的变量if(m_VideoWnd.GetSafeWnd())
{
MoveWindow(m_nWidth,m_nheight);
}用加坐标转换吗?不用吧