VC中实现文字滚动要怎么弄啊?

解决方案 »

  1.   

    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,  就一连输出两个,  
     
    如果不是,  就只输出一个  
    ---------------------------------------------------------------  
      

  2.   

    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();
      }}
      

  3.   

    在SetTimer();进行时间的控制,在ONTIMER()中进行变量的变化,在ONPAINT show。
    they are all right