我有一个状态栏的表单,其中有2 ToolStripStatusLabel秒后跟一个ToolStripProgressBar.我希望进度条始终锚定在状态栏的右侧 - 所以当窗口调整大小/最大化时,它应该自动移动 /重绘.
我认为这就像将1st(左对齐)ToolStripStatusLabel的Spring属性设置为true 一样简单,因此当窗体调整大小/增加大小,并且有更多可用空间时,1st ToolStripStatusLabel会填满该空间并自动推送ToolStripProgressBar在右边.
但这不仅没有做我想要的 - 第一个ToolStripStatusLabel实际上覆盖了第二个StatusLabel和ProgressBar基本占据整个状态栏.ToolStrip控件都没有Anchor甚至MinSize.
那我怎么做:
ToolStripProgressBarStatusBar的右侧(StatusStrip)ToolStripStatusLabel2和ToolStripProgressBar)混合在一起ToolStripStatusLabel1,如果有额外的空间,它会变大吗?在此先感谢您的时间和帮助!
〜IM
我以为我会使用一些(我认为是)简单的泛型来在某些业务类上强制执行CRUD.例如.
public interface IReadable <T>
{
T Read<T>(string ID);
}
Run Code Online (Sandbox Code Playgroud)
然后也许,我可以用NoteAdapter 用Note类做C R UD,例如.
public class NoteAdapter : IReadable<Note>
{
public Note Read<Note>(string ID) {
return new Note();
}
}
Run Code Online (Sandbox Code Playgroud)
但由于某些原因,如果我同时使用泛型返回类型和使用相同泛型类型参数化的函数,那么编译器会变得混乱.也就是说,如果我这样做:
public interface IReadable <T>
{
void Read<T>(string ID);
}
public class NoteAdapter : IReadable<Note>
{
public void Read<Note>(string ID) {
return new Note();
}
}
Run Code Online (Sandbox Code Playgroud)
编译很好,虽然它没有做我想要的!这个:
public interface IReadable <T>
{
T Read (string ID);
}
public class NoteAdapter : IReadable<Note>
{
public Note Read(string ID) {
return new …Run Code Online (Sandbox Code Playgroud) 我正在看Ben的例子@ http://www.bennadel.com/blog/1515-Ask-Ben-Building-An-AJAX-jQuery-And-ColdFusion-Powered-Application.htm并且想到一个超简单的例子我自己的.但似乎即使CFC返回格式正确的JSON,它总是在我的错误处理程序中出现错误:
Invalid JSON: {"ERRORS":"","SUCCESS":true,"DATA":"id DEX015-002-00, whs W1, qty 9"}
这是ajax电话
$.ajax({
type: 'GET',
url: 'bridge.cfc',
data: {
method: 'UpdateQty',
id: 'DEX015-002-00',
whs: 'W1',
qty: '9'
},
dataType:'json',
success: function(res, status, req){ alert("Message from server:\n" + "res: " + res); },
error: function(req, status, err){ "Error from server:\n" + "err: " + err); }
});
Run Code Online (Sandbox Code Playgroud)
继承人CFC"bridge.cfc"
<cfcomponent>
<cffunction name="UpdateQty" access="remote" returntype="struct" returnformat="json" output="false">
<cfargument name="id" required="yes" type="string">
<cfargument name="whs" required="yes" type="string">
<cfargument name="qty" required="yes" type="string">
<cfset res = structNew()> …Run Code Online (Sandbox Code Playgroud)