我正在使用C#进行应用程序WPF.我的文件夹"数据"中有三种图像.我有Iamge abd文本块和一个按钮.当我按下按钮时,它将在文本块中显示文本并取决于文本,图像可能会有所不同.如何在运行时添加图像.
public void Adddata(string lData)
{
Text1.Text = lData;
Img1.Source = "data\vista_flag.png";
}
Run Code Online (Sandbox Code Playgroud)
我知道我编码错了.但我不知道我能为此做些什么.Img1.Source = ????????
我正在VS2008 VC++ .net中开发一个应用程序
我想将应用程序移动到辅助监视器.不是通过使用鼠标单击和拖动.
按下按钮或任何快捷键是否有像MoveToMonitor这样的功能.然后它应该移动到辅助监视器.
我想将当前月份分为几周,比如第一天到周六,然后是周日到下周六.对于前者:对于五月份,所以我想把它分开
2016-05-01 to 2016-05-07
2016-05-08 to 2016-05-14
2016-05-15 to 2016-05-21
2016-05-22 to 2016-05-28
2016-05-29 to 2016-05-31
Run Code Online (Sandbox Code Playgroud)
如果我尝试下面的代码,我没有得到确切的结果.
<?php
$start_date = date('Y-m-d', strtotime('2016-06-01'));
$end_date = date('Y-m-d', strtotime('2016-06-30'));
$i=1;
for($date = $start_date; $date <= $end_date; $date = date('Y-m-d', strtotime($date. ' + 7 days'))) {
echo getWeekDates($date, $start_date, $end_date, $i);
echo "\n";
$i++;
}
function getWeekDates($date, $start_date, $end_date, $i) {
$week = date('W', strtotime($date));
$year = date('Y', strtotime($date));
$from = date("Y-m-d", strtotime("{$year}-W{$week}+1"));
if($from < $start_date) $from = $start_date;
$to = date("Y-m-d", strtotime("{$year}-W{$week}-7"));
if($to …Run Code Online (Sandbox Code Playgroud) 我创建一个Web应用程序,它从mysql获取数据并在gridview中显示.不同页面的不同数据.但现在我添加了易于用户导航的菜单项.
为此我添加了站点地图,主页面.
我的default.aspx充当登录页面.添加此母版页后,当我尝试打开应用程序时,它会显示以下错误消息.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unable to connect to any of the specified MySQL hosts.
Source Error:
Line 178: <siteMap>
Line 179: <providers>
Line 180: <add name="MySqlSiteMapProvider" type="MySql.Web.SiteMap.MySqlSiteMapProvider, MySql.Web, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/" />
Line 181: </providers>
Line 182: </siteMap>
Source File: …Run Code Online (Sandbox Code Playgroud) 我是我的选项卡控件,我想为所有选项卡 neaders 设置工具提示。我编码如下
<TabItem.ToolTip>
<StackPanel Height="40" Width="70" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="center" >
<Image VerticalAlignment="Top" Width="30" Height="10" Source="Image\TAB2.png" Name="image2" />
<TextBlock FontFamily="Aharoni" FontSize="11" Foreground="Black" TextWrapping="Wrap" VerticalAlignment="Top" Height="30" HorizontalAlignment="Right" Width="70" Text="Name Window" />
</StackPanel>
</TabItem.ToolTip>
Run Code Online (Sandbox Code Playgroud)
但是收费提示不仅出现在标题中,而且出现在所有标签页中。我只想在选项卡标题上的鼠标悬停时显示工具提示。
嗨我想在我的XAML,WPF applcation中使用的一个单独的类中获取applcation路径.在Animals.cs中,
string aPath2 = Application.StartupPath;
MessageBox.Show(path);
Run Code Online (Sandbox Code Playgroud)
它会调整错误 错误CS0117:'System.Windows.Application'不包含'StartupPath'的定义
我必须将数据提供给treeview,我将从applcation路径中的文件中获取所有详细信息.
我有通用列表-GasPropList - 因为我想要所有单个项值的总和.所有Varaible都是Double数据类型.
For Each gasprop In GasPropList
gasprop.OUTGi = gasprop.NameVal * gasprop.GasGi / 100
gasprop.OUTPci = gasprop.NameVal * gasprop.Pci / 100
gasprop.OUTTci = gasprop.NameVal * gasprop.Tci / 100
gasprop.OUTVi = gasprop.NameVal * gasprop.NHVi / 100
gasprop.OUTGVi = gasprop.NameVal * gasprop.GHDVi / 100
Next
Run Code Online (Sandbox Code Playgroud)
从这个我想要计算OUTGi,OUTPi等的总和.我看到了Linq Sum函数,但不知道如何使用我的情况.
在HTML文件中,有3个按钮作为保存,编辑和取消.我隐藏保存和编辑按钮取决于javascript中的功能.
<div class="controls col-sm-9">
<button onclick="modJs.save();return false;" class="saveBtn btn btn-primary pull-right"><i class="fa fa-save"></i> <t>Save</t></button>
<button onclick="modJs.editrecord();return false;" class="EditBtn btn btn-primary " style="display:none;"><i class="fa fa-save"></i> <t>Update</t></button>
<button onclick="modJs.cancel();return false;" class="cancelBtn btn pull-right" style="margin-right:5px;"><i class="fa fa-times-circle-o"></i> <t>Cancel</t></button>
</div>
Run Code Online (Sandbox Code Playgroud)
在我的javascript fucntion中,即时显示和隐藏编辑和保存按钮.
if(object != undefined && object != null) { //editing selected
$(".editBtn").show();
$(".saveBtn").hide();
this.fillForm(object);
}
Run Code Online (Sandbox Code Playgroud)
我已经display:none在html标签中添加了编辑按钮.如果object不为null(表示编辑),我想显示编辑按钮.通过上面的代码,保存按钮变为隐藏,但是没有显示编辑按钮.
c# ×2
wpf ×2
asp.net ×1
date ×1
date-range ×1
html ×1
image ×1
javascript ×1
master-pages ×1
mfc ×1
php ×1
tabcontrol ×1
tooltip ×1
vb.net ×1