如何在MFC中进行平面进度条控制 [英] How to make flat Progress bar Control in MFC

查看:111
本文介绍了如何在MFC中进行平面进度条控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用visual Studio 2010,开发一个基于MFC对话框的应用程序,我在其中放置了Progress bar Control。

我已经从工具箱中放置了默认进度条控件。现在,我想要更改Progress Bar控件的外观,还希望在Progress Bar控件上放置Time重命名文本。你可以给我一些想法。



想要一个扁平的MFC进度条控件。

I am using visual Studio 2010 , developing an MFC dialog based application, where I have placed Progress bar Control.
I have placed the default progress Bar Control from the Tool Box. Now as I want to change the look and feel of Progress Bar control and also want place Time renaming text on the Progress Bar control. can you please suggest me some ideas.

Wanted a Flat MFC Progress bar Control.

推荐答案

你好



你可以将.net控件用到MFC中它真的很有用所以只需看看这里;-)



在MFC对话框中托管Windows窗体用户控件 [ ^ ]



最好的问候。
Hi

you can use .net controls into MFC and it can be really useful so just look at here ;-)

Hosting Windows Forms User Control in MFC Dialogs[^]

Best Regards.


1。我们可以使用API​​ :: SetWindowTheme(HWND,_T(),_ T()。HWND可以是进度条的控制变量,它会使它显示为Flat进度条。



2.另一种我没想完全使用CProgressbar Control的方法。我们可以从CStatic派生我们自己的类,并定义我们班级的OnPaint消息,例如



MyProgress :: Onpaint()

{



}



我们可以在静态框中绘制矩形作为进度填充。也可以将其他函数区别为Setrange(),SetPos(),SetpIt()等,其行为类似于Progressbar也显示文本。
1. We can use API ::SetWindowTheme(HWND,_T(""),_T(""). HWND can be control variable of your progress bar which will make it appear as a Flat progress bar.

2. Another way I figured out not using CProgressbar Control completely. We can derived our own class from CStatic and define OnPaint message of our class for example

MyProgress::Onpaint()
{

}

Where we can draw rectangle to fill as Progress on the static box. Also can differ other functions as Setrange(),SetPos(),SetpIt() etc. to behave as like Progressbar also display text on it.


这篇关于如何在MFC中进行平面进度条控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆