VC中实现文字滚动要怎么弄啊? VC中实现文字滚动要怎么弄啊? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 vc中怎么实现“走马灯”效果!既在状态栏中怎么让内容滚动! 主要解答者: willa 提交人: zjp899 感谢: guoxiny 审核者: masterz 论坛对应贴子: 查看 A : vc中怎么实现“走马灯”效果!既在状态栏中的内容不断的滚动!类似于网页中的走马灯效果!高分酬谢!! --------------------------------------------------------------- 通过SetTimer设定一个时间在 const CString str1 = "......"; OnTimer() { static int count =0; CString str2; if(count > str.GetLength()) count = 0; str2 = str1.Mid(count,10); m_wndStatusbar.SetPaneText(0,str2) count+=5; } --------------------------------------------------------------- 那你可以加上一个判断, 如果将要输出的字符ASCII码大于127, 就一连输出两个, 如果不是, 就只输出一个 --------------------------------------------------------------- char str[]="asdfasdfadsfa"; DWORD time=0; HDC Dlghdc=GetDC(parent);//获得窗口的设备描述句柄 UINT position=200,newpos=25;//文字位置 while ( newpos < 200) {if (GetTickCount() - time >10) { position--; SetTextColor(Dlghdc,RGB(255,0,1)); TextOut(Dlghdc,75,position,(LPCTSTR)str,strlen(str)); SetBkColor(Dlghdc,TRANSPARENT);//TRANSPARENT UpdateWindow(parent); ReleaseDC(parent, Dlghdc); newpos++; time=GetTickCount(); ReleaseCapture(); }} 在SetTimer();进行时间的控制,在ONTIMER()中进行变量的变化,在ONPAINT show。they are all right 完成端口中队列和工作者线程的作用? GDIplus SaveAdd Win32Error 数据类型转换问题(初级_variant_t型转换成CString型) 【新手】如何计算两个矩形的交集?(用于判断两个矩形是否相邻) 如何控制显示文本的颜色 请教各位高手:下面代码有何错误? 新手的问题。 小菜问大家一个问题,怎样在应用程序中执行已有的EXE程序? 怎么画出一个时钟图像,并使指针移动? 不存在从 "CString" 到 "char *" 的适当转换函数求教 为什么关闭文件时会出错?谢谢! 初学者的指针问题..
主要解答者: willa 提交人: zjp899
感谢: guoxiny
审核者: masterz 论坛对应贴子: 查看
A : vc中怎么实现“走马灯”效果!既在状态栏中的内容不断的滚动!类似于网页中的走马灯效果!高分酬谢!!
---------------------------------------------------------------
通过SetTimer设定一个时间在
const CString str1 = "......";
OnTimer()
{
static int count =0;
CString str2;
if(count > str.GetLength())
count = 0;
str2 = str1.Mid(count,10);
m_wndStatusbar.SetPaneText(0,str2)
count+=5;
}
---------------------------------------------------------------
那你可以加上一个判断, 如果将要输出的字符ASCII码大于127, 就一连输出两个,
如果不是, 就只输出一个
---------------------------------------------------------------
HDC Dlghdc=GetDC(parent);//获得窗口的设备描述句柄
UINT position=200,newpos=25;//文字位置
while ( newpos < 200)
{if (GetTickCount() - time >10)
{ position--;
SetTextColor(Dlghdc,RGB(255,0,1));
TextOut(Dlghdc,75,position,(LPCTSTR)str,strlen(str));
SetBkColor(Dlghdc,TRANSPARENT);//TRANSPARENT
UpdateWindow(parent);
ReleaseDC(parent, Dlghdc);
newpos++;
time=GetTickCount();
ReleaseCapture();
}}
they are all right