我正在开发windows phone 7应用程序.我是窗口手机7应用程序的新手.我的应用程序中有以下列表框控件
<ListBox Margin="0,355,70,205" Name="WeekSummaryListBox" DataContext="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Template>
<ControlTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<ItemsPresenter />
</ScrollViewer>
</ControlTemplate>
</ListBox.Template>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
在上面的列表框中,控件项目是垂直显示的.我想在列表框控件中显示项目.所以我使用以下代码.
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
Run Code Online (Sandbox Code Playgroud)
但是当我将两个文本块放在stackpanel中时,它会出错.为此,我使用以下代码
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
我正在尝试以下代码.在下面的代码中我收到错误
<ListBox Margin="0,355,70,205" Name="WeekSummaryListBox" DataContext="{Binding}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Amount}" Foreground="Orange"></TextBlock>
<TextBlock TextWrapping="Wrap" Width="150" Text="{Binding Currency}" Foreground="Orange"></TextBlock> …Run Code Online (Sandbox Code Playgroud) 我想得到一周的开始日期.我能够得到日期,只是返回的日期与当前系统时间有关.例如,如果现在是19:20小时,我将星期开始日期定为日期{2012年3月26日19:20:16 GMT + 0530(IST)}
为了准确计算,我需要时间为格林威治标准时间00:00:00.
我怎样才能做到这一点?
我当前的代码如下所示:
var tDate = new Date();
var wDate = new Date();
this.chosenDayIndex = this.currentDayIndex = tDate.getDay();
if (this.currentDate == '') {
this.currentDate = new Date();
var today = formatDate(tDate);
var diff = tDate.getDate() - this.currentDayIndex + (this.currentDayIndex == 0 ? -6:1);
this.weekStartDate = this.weekMonDate = new Date(wDate.setDate(diff));
this.weekEndDate = new Date(this.weekStartDate.getFullYear(),this.weekStartDate.getMonth(), this.weekStartDate.getDate()+6);
this.weekMonday = formatDate(this.weekMonDate);
}
Run Code Online (Sandbox Code Playgroud)
this.weekStartDate当前正在使用当前时间戳分发错误的开始日期.
我一直在尝试使用document.getElementByID从外部JS文件中提取HTML文件中的信息,但它似乎不起作用.是否document.getElementByID只有工作,如果它是内嵌在HTML文件或可以在一个外部JS文件正常工作?正确地在HTML文档中调用JS文件,因为其他功能正在运行.
这是用于在另一个数字后添加逗号的代码,但我想删除最后一个逗号:
str_MSISDN.Append("'" + _MSISDN[x].TrimStart() + "'" + ",");
Run Code Online (Sandbox Code Playgroud) 码:
var csMasterPrefix = 'CS_',
cpMasterPrefix = 'CP_',
csContentPrefix = 'CSContent_',
cpContentPrefix = 'CPContent_';
/* ... */
$this.attr("id")
.replace(csMasterPrefix,'')
.replace(cpMasterPrefix,'')
.replace(csContentPrefix,'')
.replace(cpContentPrefix,'')
.replace('ibtn','')
.replace('btn','')
.replace('lbtn','')
.replace('img','')
.toLowerCase();
Run Code Online (Sandbox Code Playgroud)
问题:让我先说一下,我已经看过制定自己"干净"功能的解决方案.我的问题实际上不是如何做到这一点,而是我如何制作一个将所有替换调用合并为一个的正则表达式?
我有一个<section />由div组成的隐藏,其中包含要填充到jQuery UI对话框中的内容.在document.ready上我想循环遍历这些div,获取每个div的id,用空格替换破折号,大写每个单词,并将其存储在title变量中.然后,我将在一个被放入我的dialogs[]数组的对象文字中使用它.听起来很简单吧?
剥离版本的HTML:
<section id="dialog-content" class="hidden">
<div id="some-dialog">
// awesome dialog content here
</div>
<div id="another-dialog">
// awesome dialog content here
</div>
<div id="modal-dialog">
// awesome dialog content here
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
剥离版本的JavaScript:
var dialogs = [],
$container = $("#dialog-content");
$content = $container.find("> div");
$content.each(function (i)
{
var $this = $(this),
id = $this.attr("id"),
title = id.replace(/\-/g, " ");
console.log(title);
dialogs[dialogs.length] =
{
trigger: $("#" + id + "-trigger"),
title: title,
content: $this.html()
};
});
Run Code Online (Sandbox Code Playgroud)
顺便说一句 …
我有jQuery UI"smoothness"主题,我想在我的页面上使用"look"来设置样式div.例如,将灰色,阴影,圆角效果应用于不是手风琴,按钮等的常规div .
我觉得这很容易!也许是这样的?!
谢谢!
我不明白为什么故事板中的背景颜色设置不适用于我的导航控制器?(见图)
我在这里将它设置为鲜红色但是你可以看到它在故事板或应用程序中没有任何功能,当我构建它时.
有什么想法吗?
我知道我可以通过编程方式设置颜色,这就是我目前正在做的事情.但是,很高兴看到故事板中的更改,因此每次我进行颜色更改以查看差异时,我都不必构建应用程序.
问题是AutoComplete也会显示第1列以外的列.在第1列中输入文本然后它将开始显示其他列之前,它不会出现.
我的代码:
public AutoCompleteStringCollection ClientListDropDown()
{
AutoCompleteStringCollection asc = new AutoCompleteStringCollection();
try
{
Query = "Select top 5 title from customer "; // just removed where name like '%" + txtDVNo.Text + "%' plz check
cmd = new SqlCommand(Query, GlobalVars.conn);
dr = cmd.ExecuteReader();
if ((dr != null) && (dr.HasRows))
while (dr.Read())
asc.Add(dr.GetValue(0).ToString());
dr.Close();
cmd.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return asc;
}
private void dgvDVDetails_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dgvDVDetails.CurrentCell.ColumnIndex == 1)
{
TextBox prodCode …Run Code Online (Sandbox Code Playgroud) 下面的缩短代码可行,但它最终使用ApplicationPool标识,而不是我在数组中指定的特定标识.
声明:
#App pool array positions
$Name = 0
$User = 1
$Pwdx = 2
#Application array positions
$SiteNm = 0
$PhyPath = 1
$PoolNm = 2
#App Pool Settings
$Port="80"
$HostName="*"
$Environment="local"
$Runtime="v4.0"
$Pipeline="0" #Integrated
$Identity="3" #SpecificUser
#Define the App Pools
$Pools = @(3)*2
$Pools[0] = "SomeAppPool","FooBar\SomeUser","S0meUs3rP4ssw0RD"
$Pools[1] = "AnotherAppPool","FooBar\AnotherUser","An0th3rUs3rP4ssw0RD"
Run Code Online (Sandbox Code Playgroud)
执行代码:
Import-Module WebAdministration
#navigate to the app pools root
cd IIS:\AppPools\
foreach($p in $Pools)
{
$AppPoolName = $p[$Name]
$AppPoolUser = $p[$User]
$AppPoolPwd = $p[$Pwdx]
$appPool = New-Item $AppPoolName
$appPool …Run Code Online (Sandbox Code Playgroud) javascript ×4
jquery ×3
c# ×2
autocomplete ×1
capitalize ×1
css ×1
csv ×1
dom ×1
html ×1
iis ×1
iis-8.5 ×1
ios ×1
ios7 ×1
jquery-ui ×1
listbox ×1
powershell ×1
regex ×1
replace ×1
silverlight ×1
stackpanel ×1
uistoryboard ×1
xcode ×1
xcode5 ×1