我有一个程序需要一些时间来创建 pdf 文件我想向用户显示进度
当我完成一个 pdf 文件时,我尝试调用进度条来更新它的状态:
ProgressDialog progress = new ProgressDialog(instance, numberOfInvoices);
progress.setVisible(true);
progress.setAlwaysOnTop(true);
for(int i = 0 ; i<numOfPdfs ; i++){
progress.change(i + 1);
}
Run Code Online (Sandbox Code Playgroud)
进度对话框如下所示:
public class ProgressDialog extends JDialog {
private JProgressBar progressBar;
public ProgressDialog(Window parent, int aantal) {
super(parent);
this.setPreferredSize(new Dimension(300, 150));
progressBar = new JProgressBar(0, aantal);
progressBar.setValue(0);
progressBar.setSize(new Dimension(280, 130));
this.add(progressBar, BorderLayout.CENTER);
this.pack();
this.setLocationRelativeTo(parent);
}
public void change(int aantal) {
if (aantal < progressBar.getMaximum() && aantal >= 0) {
progressBar.setValue(aantal);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的只是一个空窗口(白色)
我在这个论坛上环顾四周,但踏板解决方案似乎太复杂了 …
我有15到20个标签,文本大小可变,文本框排列在表格中.文本框排列在标签旁边.表单的字体和颜色以及表单控件可以由用户在运行时配置.当我右对齐标签并将auto grow属性设置为true时,无论何时字体样式发生变化(例如从Arial到Georgia),右对齐标签都不再右对齐.
我需要一个标签上的解决方案(用于winforms),以便在字体大小改变时自动增长到左侧.
这是我的错误消息:
无法加载文件或程序集'file:/// C:\ Windows\system32\Rule.dll'.该系统找不到指定的文件.
问题是同一个exe在我的开发环境中工作,但在生产服务器上不起作用.该程序是一个应该作为Windows Server 2008上的计划任务运行的工具.它由一个exe,一个所谓的Database.dll和Rule.dll组成.exe应该在代码隐藏中动态加载Rule.dll,但只有从任务计划程序启动时才会出现上述错误.为什么它在System32文件夹中而不是在Application文件夹中?这是UAC问题吗?
'Load the rule engine into memory
Dim asmRule As System.Reflection.Assembly = Nothing
Try
asmRule = System.Reflection.Assembly.LoadFrom("Rule.dll") 'fails on productive system
Catch ex As System.Exception
HistoryLog.writeLog("SysLog", ex, "Cannot find Rule.dll in Application Folder")
End Try
Run Code Online (Sandbox Code Playgroud) 我正在用PHP 5.3编写一个库,其中大部分是一个具有多个静态属性的类,这些属性从子类扩展到允许子类的零-conf.
无论如何,这里有一个样本来说明我发现的特殊性:
<?php
class A {
protected static $a;
public static function out() { var_dump(static::$a); }
public static function setup($v) { static::$a =& $v; }
}
class B extends A {}
class C extends A {}
A::setup('A');
A::out(); // 'A'
B::out(); // null
C::out(); // null
B::setup('B');
A::out(); // 'A'
B::out(); // 'B'
C::out(); // null
C::setup('C');
A::out(); // 'A'
B::out(); // 'B'
C::out(); // 'C'
?>
Run Code Online (Sandbox Code Playgroud)
现在,就我而言,这是静态继承的非常理想的行为,然而,static::$a =& $v;
改为static::$a = $v;
(无引用)你得到我期望的行为,即:
'A'
'A'
'A' …
Run Code Online (Sandbox Code Playgroud) 在c ++中,setw函数用于设置要用作下一个插入操作的字段宽度的字符数.在C中是否有任何函数,我的意思是,在标准c库中,它做同样的事情?
我在SQL Server 2000上有一个存储过程,它有3个参数.当我使用SqlCommand.ExecuteReader()从DotNet调用存储过程时,大约需要28秒.
当我在SSMS中直接运行相同的查询时,它会立即返回.
当我从存储过程中取出查询并使用DotNet直接运行时,它也会立即返回.
这些是SQL事件探查器会话的结果
SP内部网点
SP内部SSMS
直接在Dot Net内部查询
以下事情对我来说很突出:
任何帮助,将不胜感激.
这是SP的略微观察版本:
我怀疑它是一个查询计划问题,因为即使我从DotNet反复运行它,我总是得到相同的结果.
这是SP的一个版本,由于IP问题而略有改变.我希望它仍然有意义:
SELECT
t1.pkiOrderID,
t1.fkiBasketId,
t1.sOriginBasketCode,
t1.dtDateCreated,
t1.sOrderCode,
t1.fkiUserCde,
t1.fkiOrgCde,
t1.sApprovalPerson,
t1.dtDateApproved,
t1.sRequestNo,
t1.dtRequiredDate,
t1.Requestor,
t1.OnBehalfOf,
t1.OrderDesc,
t1.OrderTypeId,
t1.fkiAgentID,
t1.fkiAgentRegionID,
stat.iStatus,
count(oi.pkiOrderItemId) as OrderItems,
count(wf.fkiOrderId) as WorkflowCount,
t1.Currency_Id,
t1.ExchangeRate,
t1.ref_odr_idn,
t2.sOrderCode as ref_odr_cde,
t1.ref_rfq_nbr,
t1.ref_rfs_nbr,
t1.ref_doc_nbr,
t1.ref_rsn,
t1.ref_forip_cde,
t1.ref_fa_nbr,
t1.odr_sub_typ
FROM tbl1 t1 INNER JOIN
tbl1Status stat ON
t1.pkiOrderID = stat.fkiOrderID AND …
Run Code Online (Sandbox Code Playgroud) 我SeekBar
在我的应用程序中使用了一个,我想稍微定制一下.我已经想出了如何改变Drawable
拇指和背景.
我的问题是如何改变大小SeekBar
?如果我只是改变SeekBar like this, the
View is only clipped and it only shows the top piece of the
SeekBar` 的高度:
<SeekBar
android:layout_height="10dip"
style="@style/seekbar_style" />
Run Code Online (Sandbox Code Playgroud)
如何更改整体尺寸Seekbar
?我希望它比标准更薄SeekBar
.
I'm creating a tabcontainer that shows information from partials. The code that i've created is as follows:
//Entering extension method, m_helper is of type HtmlHelper
foreach (var tab in m_tabList)
{
sb.AppendLine("<div class='tabContent'>");
m_helper.RenderPartial(tab.PartialName);
sb.AppendLine("</div>");
}
//Returning sb.ToString to the caller method
Run Code Online (Sandbox Code Playgroud)
This will not work because the renderpartial writes directly to the output stream. I cannot render the partial to a string either. to add it to the stringbuilder object.
Any suggestions?
.net ×4
c# ×3
java ×2
.net-2.0 ×1
ado.net ×1
android ×1
asp.net-mvc ×1
c ×1
dll ×1
generics ×1
inheritance ×1
jprogressbar ×1
pcap ×1
php ×1
php-5.3 ×1
reference ×1
seekbar ×1
sql-server ×1
vb.net ×1
windows ×1