我有一个带有ScrollViewer的应用程序.2个滚动条相遇的地方是一个讨厌的小方块(见下面的img)我试图摆脱它.当我"窥探"应用程序时,我可以将其视为"矩形",但我认为它是ScrollViewer的一部分?
我搜索并搜索了有关此内容的任何信息,但我发现的所有内容都是通过在顶部放置内容来隐藏它的建议:s
任何人都可以指出我正确的方向来排序这个?

<ControlTemplate x:Key="HorizontalScrollBar"
TargetType="{x:Type ScrollBar}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="18"/>
<ColumnDefinition Width="0.00001*"/>
<ColumnDefinition MaxWidth="18"/>
</Grid.ColumnDefinitions>
<Border
Grid.ColumnSpan="3"
CornerRadius="2"
Background="Transparent" />
<RepeatButton
Grid.Column="0"
Style="{StaticResource ScrollBarLineButton}"
Width="18"
Command="ScrollBar.LineLeftCommand"
Content="M 4 0 L 4 8 L 0 4 Z" />
<Track
Name="PART_Track"
Grid.Column="1"
IsDirectionReversed="False">
<Track.DecreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageLeftCommand" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb
Style="{StaticResource ScrollBarThumb}"
Margin="0,1,0,1"
Background="{DynamicResource NormalBrush}"
BorderBrush="{DynamicResource NormalBorderBrush}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton
Style="{StaticResource ScrollBarPageButton}"
Command="ScrollBar.PageRightCommand" />
</Track.IncreaseRepeatButton>
</Track>
<RepeatButton
Grid.Column="3"
Style="{StaticResource ScrollBarLineButton}"
Width="18"
Command="ScrollBar.LineRightCommand"
Content="M 0 0 L 4 …Run Code Online (Sandbox Code Playgroud) 我已经搜索了我的问题的答案,但找不到答案.抱歉,如果答案在那里,我正在重复!
我一直在看try/catch代码......
try
{
//Do whatever
}
catch (Exception ex)
{
MessageBox.Show("Oops, something went wrong!");
}
Run Code Online (Sandbox Code Playgroud)
这将导致警告ex从未使用过.
所以我的问题是......虽然从未使用过ex,但声明中是否有任何好处?有人告诉我,它可能会为堆栈跟踪添加细节吗?有时我看到catch(Exception)会停止警告但是这带来了什么好处呢?如果我要写这个并且不以任何方式使用异常我不会声明ex ...
try
{
//Do whatever
}
catch
{
MessageBox.Show("Oops, something went wrong!");
}
Run Code Online (Sandbox Code Playgroud)
这不是一个大问题,但肯定知道会很好!
谢谢
弗雷德
我有一个自定义数据类型列表,简化示例(myMovies):
public class Movie
{
public Int32 TVIndex;
public string MovieName;
public string MovieRating;
public string MovieRuntime;
public List<Actor> MovieActors;
public List<MovieArt> MovieImages;
}
public class Actor
{
public string ActorName;
public string ActorRole;
}
public class MovieArt
{
public string ImagePath;
}
List<Movie> myMovies = new List<Movie>();
Run Code Online (Sandbox Code Playgroud)
现在我试图删除所有重复myMovies但忽略TVIndex.
我试过看
List<Movie> myDistinctMovies = myMovies.Distinct().ToList();
Run Code Online (Sandbox Code Playgroud)
但无法弄清楚如何忽视TvIndex.这可能吗?
我有一个MVC视图,上面有许多按钮(篮子里的每个项目都有2个按钮)......
<button class="pbbg" id="ProductMinus_161637" type="button">-</button>
<button class="pbbg" id="ProductPlus_161637" type="button">+</button>
Run Code Online (Sandbox Code Playgroud)
(他们都有一个onclick活动)
当按下这些按钮中的任何一个时,我想禁用每个产品的所有按钮,直到篮子完成更新.
click事件调用JavaScript函数,而JavaScript函数又调用Ajax.在这篇文章之后,我尝试做的第一件事是禁用所有按钮.....
$("input[type=button]").attr("disabled", "disabled");
Run Code Online (Sandbox Code Playgroud)
然后在Ajax调用返回后重新启用它们....
$("input[type=button]").removeAttr("disabled");
Run Code Online (Sandbox Code Playgroud)
我没有错误,但按钮没有被禁用.
我哪里错了?
我有一个字符串
var myString = "['Item', 'Count'],['iPad',2],['Android',1]";
Run Code Online (Sandbox Code Playgroud)
我需要将其转换为数组,其中:
myArray[0][0] = 'Item';
myArray[0][1] = 'Count';
myArray[1][0] = 'iPad';
myArray[1][1] = 2;
Run Code Online (Sandbox Code Playgroud)
等等...
字符串的长度可以不同,但始终采用上面的格式.我尝试过分裂和拼接以及任何其他"我能想到的",但我无法理解.
有人可以帮忙吗?
我有一个应用程序,通过网络将大量文件复制到文件服务器(而不是Web).我试图显示剩余时间的一半估计.
我已经看了很多关于SO的文章,但问题得到了解决,我没有尝试过我真正想做的事情.我希望估计的剩余时间相对稳定IE不会在整个地方跳转,这取决于波动的传输速度.
所以我看到的第一个解决方案是计算传输速度,以每秒字节数为单位
double bytePerSec = totalBytesCopied / TimeTaken.TotalSeconds;
Run Code Online (Sandbox Code Playgroud)
然后将剩余的总字节除以传输速率.
double secRemain = (totalFileSizeToCopy - totalBytesCopied) / bytePerSec;
Run Code Online (Sandbox Code Playgroud)
我认为,一旦复制了几MB,剩余的时间会变得更加稳定(尽管期望它会改变.但事实并非如此,它的不稳定性和跳跃遍布整个地方.
然后我在SO上尝试了一个解决方案....
double secRemain = (TimeTaken.TotalSeconds / totalBytesCopied) * (totalFileSizeToCopy - totalBytesCopied);
Run Code Online (Sandbox Code Playgroud)
这是一个类似的计算,但希望它可能有所作为!
所以现在我有点想我需要从不同的角度来看待这个问题.IE使用平均值?使用某种倒数计时器并重置每隔一段时间的时间?只是寻找已经遇到过这个问题的人的意见或建议.
我尝试在 SQL Server 2014 上使用“CONTAINS()”实现搜索机制。
我在这里阅读了https://technet.microsoft.com/en-us/library/ms142538%28v=sql.105%29.aspx和我需要的“SQL Server 2008 中的专业全文搜索”一书使用双引号来搜索精确的短语。
但是 eq 如果我使用它,CONTAINS(*, '"test"')我也会收到包含“numerictest”之类的词的结果。如果我尝试CONTAINS(*, '" test "')它是一样的。我注意到,结果较少,就像我会搜索CONTAINS(*, '*test*')前缀、后缀搜索一样,因此搜索之间肯定存在差异。
我没想到第一个语句中的“numerictest”。这种行为有解释吗?
我在 gridview 中显示数据并希望有条件地更改单元格中文本的颜色。
所以在RowDataBound网格上
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (((SurveyListHeader)(e.Row.DataItem)).PositionalConfidence != "G1" && ((SurveyListHeader)(e.Row.DataItem)).PositionalConfidence != "G3")
{
e.Row.Cells[3].ForeColor = System.Drawing.Color.Red;
//e.Row.Cells[3].BorderColor = System.Drawing.Color.Black;
}
if (((SurveyListHeader)(e.Row.DataItem)).PositionalConfidence != "G2" && ((SurveyListHeader)(e.Row.DataItem)).PositionalConfidence != "G3")
{
e.Row.Cells[4].ForeColor = System.Drawing.Color.Red;
//e.Row.Cells[4].BorderColor = System.Drawing.Color.Black;
}
}
Run Code Online (Sandbox Code Playgroud)
然而,这也会导致边框颜色发生变化。

我曾尝试将边框颜色改回黑色,但这不起作用。
我尝试向单元格的 CSSStyleCollection 添加样式项,但仍然没有任何乐趣。
我已经看到其他人遇到了这个问题,但没有任何答案适合我。有什么建议?
我已经尝试过我找到的解决方案,似乎无法让这项工作适合我.
我有一节课:
public class InvokeGetReportRequestListResponse
{
public MarketplaceWebServiceException Error { get; set; }
public bool CallStatus { get; set; }
public List<RequestedReport> Reports { get; set; }
}
public class RequestedReport
{
public String ReportRequestId;
public String ReportType;
public DateTime? StartDate;
public DateTime? EndDate;
public Boolean Scheduled;
public DateTime? SubmittedDate;
public String ReportProcessingStatus;
public String GeneratedReportId;
public DateTime? StartedProcessingDate;
public DateTime? CompletedDate;
}
Run Code Online (Sandbox Code Playgroud)
我打电话给服务:
InvokeGetReportRequestListResponse callResponse = InvokeGetReportRequestList(callRequest);
Run Code Online (Sandbox Code Playgroud)
现在我要排序的Reports列表中callResponse通过CompletedDate
callResponse.Reports.Sort((x, y) => DateTime.Compare(x.CompletedDate, y.CompletedDate));
这会返回一个错误: …
我一直在愉快地开发MVC / Sitecore App,一切都很好。
但是突然之间我出现了一个错误,告诉我我一直在Object reference not set to the instance of an Object继续。错误页面指向一行,除了右括号。
我尝试删除可能导致错误的视图中的代码行,但该错误仍保留在同一右括号中。
所以我注释掉了整个语句,包括右括号。现在我收到以下错误:
“ /”应用程序中的服务器错误。
你调用的对象是空的。
说明:发生未处理的异常。
异常详细信息:System.NullReferenceException:对象引用未设置为对象的实例。
源错误:
[没有相关的源代码行]
源文件:c:\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \临时ASP.NET文件\ root \ 1a47b3ff \ 21a05ef3 \ App_Web_kieomnc4.1.cs行:0
[NullReferenceException:对象引用未设置为对象的实例。]
c。\ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ Temporary ASP.NET Files \ root \ 1a47b3ff \ 21a05ef3 \ App_Web_pjrqnchq.1.cs:0
System.Web.WebPages.WebPageBase.ExecutePageHierarchy()+279
System.Web.Mvc.WebViewPage.ExecutePageHierarchy()+124
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext,TextWriter writer,WebPageRenderingBase startPage)+109
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext上下文)+379 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) …
c# ×6
javascript ×2
.net ×1
ajax ×1
asp.net ×1
asp.net-mvc ×1
contains ×1
css ×1
file-copying ×1
gridview ×1
html ×1
jquery ×1
linq ×1
list ×1
math ×1
sql-server ×1
wpf ×1