vb6数据报告 - 在运行时更改文本颜色

问题描述:

请有人在那里帮助我!!!!!!!!!!!!

我在vb6中构建数据报告。为简单起见,报告上有一个三个文本框。第一个用于(日期),第二个用于(及时),第三个用于(待命时间)。数据正在SQL数据库的文本框中填写。

我想要的是条件if(In-Time)大于例如07:30然后在文本框中显示的时间在报告中必须是红色的。同样,如果(In-Time)小于07:30,文字颜色应为黑色。


感谢Zillion !!!!!!!!!!!!! !!!!!!!!!!

Hi, Please anyone out there can help me!!!!!!!!!!!!
I am building a Data Report in vb6. To make it simple there a three text box on the Report. First for (Date), Second for (In-Time) and the third for (Out-Time). The data is being filled in the text box from SQL Database.
What i want is to put condition that if (In-Time) is greater than e.g. 07:30 then the time diplayed in the text box must be RED in color in the report. Likewise if the (In-Time) is less than 07:30 the text color should be Black color.

Thanks a Zillion!!!!!!!!!!!!!!!!!!!!!!!

问候,Irfi!


我听到你的痛苦。我尝试了一些文本框,但对我来说也没用。我马上要再拍一次。有人可能会提出更好的解决方案。别担心。与此同时,这是一个解决方案。您应该考虑添加标签以从数据库中收集时间:


您的表单代码

Greetings, Irfi!

I hear your pain. I tried something with a textbox and it did not work for me either. I am going to take another shot at it in a moment. Someone will likely come up with a better solution. No worries. In the meantime, Here is a solution. You should consider adding labels to gather the time from the database whereby:

Your form code

展开 | 选择 | Wrap | 行号



请有人在那里帮助我!!!!!!!!!!!!

我正在vb6中构建数据报告。为简单起见,报告上有一个三个文本框。第一个用于(日期),第二个用于(及时),第三个用于(待命时间)。数据正在SQL数据库的文本框中填写。

我想要的是条件if(In-Time)大于例如07:30然后在文本框中显示的时间在报告中必须是红色的。同样,如果(In-Time)小于07:30,文字颜色应为黑色。


感谢Zillion !!!!!!!!!!!!! !!!!!!!!!!
Hi, Please anyone out there can help me!!!!!!!!!!!!
I am building a Data Report in vb6. To make it simple there a three text box on the Report. First for (Date), Second for (In-Time) and the third for (Out-Time). The data is being filled in the text box from SQL Database.
What i want is to put condition that if (In-Time) is greater than e.g. 07:30 then the time diplayed in the text box must be RED in color in the report. Likewise if the (In-Time) is less than 07:30 the text color should be Black color.

Thanks a Zillion!!!!!!!!!!!!!!!!!!!!!!!



您只需要检查时间并设置TextBox的ForeColor属性。这样的事情,除了你可能已经有时间在DateTime变量。

You just need to check the time and set the ForeColor property of the TextBox. Something like this, except you will probably already have the time in a DateTime variable.

展开 | 选择 | Wrap | 行号



您只需要检查时间并设置TextBox的ForeColor属性。这样的事情,除了你可能已经有时间在DateTime变量。
You just need to check the time and set the ForeColor property of the TextBox. Something like this, except you will probably already have the time in a DateTime variable.
展开 | 选择 | Wrap | 行号