我有一个标签,其内容通过 while 循环显示。当我在标签中显示文本时,它会正确显示。有时几分钟,相同的文本显示在相同的标签中,并且控件中的文本大小发生变化。
这是代码:
//Form_Load :
Thread t = new Thread(displaySentences);
t.Start();
//display sentences:
void displaySentences()
{
while(true)
{
if(i>=5)
i=0;
label4.Text = textarray[i];
i++;
}
}
Run Code Online (Sandbox Code Playgroud)
第一次迭代(i=0)中的文本大小与第二次迭代中标签控件中的文本大小不同。
有没有人有资源从哪里学习使用Delphi的SAPI?
如何使用Delphi应用程序的语音识别?
谢谢.
我想问一下,为诺基亚1200手机开发J2ME应用程序然后安装应用程序以及J2ME/Java运行时是可能的,因为诺基亚1200似乎不包含J2ME/Java运行时:(http:// www. mobile88.com/cellphone/Nokia/Nokia-1200/specification.asp).
我正在寻找一个JBoss MQ教程(在JBoss工具上),这样我就可以编写一个MDB和一个客户端.我只能找到JBoss Messaging.
我有两个班:单元和用户.
Unit类具有User作为leader,而User可以是许多单元的一部分.
class Unit
{
User Leader;
public void SetLeader(User leader)
{
this.Leader=leader;
}
}
class User
{
Unit UnitLed;
public void LeadUnit(Unit unit)
{
this.UnitLed=unit;
unit.SetLeader(this);
}
}
Run Code Online (Sandbox Code Playgroud)
我如何强制执行它,以便使用这些类的开发人员不会错误地调用如下代码:
User _user=new User();
Unit _unit=new Unit();
_user.LeadUnit(_unit);
_unit.SetLeader(_user);
Run Code Online (Sandbox Code Playgroud)
但人们以这种方式使用这些类:
_user.LeadUnit(_UNIT)
我一直在写一个C#.NET应用程序.我正在使用WinForms.所以,我有一些表单加载速度非常慢,特别是因为它们从一些XML文件中获取一些数据并在ListBox控件中显示它们.
我要问的是:如何使表单加载速度更快.或者我如何继续显示旋转轮的图像(通常在等待软件完成操作时看到的图像).
谢谢.
如何从C#.NET应用程序启动文档打印?Word文档已存在于硬盘驱动器中.我只想在按钮点击事件上开始打印Word文档.
我有一个方法:
private String getProperty(String property) throws IOException,ConfigException {
// first test if the config file exists.
String propertyFile = "DataTransfer/Config/DataTransfer.properties";
if(!new File(propertyFile).exists()) {
throw new ConfigException("the config file doesn't exist." +
" Make sure the file : \""+propertyFile+"\" exists.");
}
// retrieve the property
Properties configFile = new Properties();
configFile.load(this.getClass().getClassLoader()
.getResourceAsStream(propertyFile));
String prop = configFile.getProperty(property);
return prop;
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,我一直在java.lang.NullPointerException达到这个ConfigFile.load()水平.
我在调试模式下检查了我的变量,它们都不是null.
我不知道这个例外的原因是什么.
我有以下形式的文件名:/folder/file.jpg我想通过删除任何额外的正斜杠来消毒.
例如:
'/tt////Images/WP1213.jpg' => '/tt/Images/WP1213.jpg' (example 1)
'///tt/Images/WP1213.jpg' => '/Images/WP1213.jpg' (example 2)
Run Code Online (Sandbox Code Playgroud)
我使用了以下正则表达式:myString.replace(/\/+/, "/")
但是,这不适用于示例1,它仅适用于示例2.
我如何编写一个捕获示例2的正则表达式?
我有多个 sql 查询,我想将它们捆绑到一个查询中,这样我就可以避免从我的应用程序向数据库发送多个请求(我想一次性接收所有这些数据):
1) select pin, officeNum, isVeteran from table18 where pin = 123;
2) select streetAddress, apartmentAddress, cityAddress, stateAddress from table1 where case = (select case from table18 where pin = 123);
3) select unitAddress, cityAddress, streetAddress, apartmentAddress from table5 where pin = 123;
4) select unitAddress, cityAddress, streetAddress, apartmentAddress from table55 where seqNum = 0 and rfa = (select rfa from table18 where pin = 123);
5) select unitAddress, cityAddress, streetAddress, apartmentAddress from table103 where histCode = 0 …Run Code Online (Sandbox Code Playgroud)