我在Windows启动时获得了以下代码来运行应用程序:
private void SetStartup(string AppName, bool enable)
{
string runKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
Microsoft.Win32.RegistryKey startupKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(runKey);
if (enable)
{
if (startupKey.GetValue(AppName) == null)
{
startupKey.Close();
startupKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(runKey, true);
startupKey.SetValue(AppName, Application.ExecutablePath.ToString());
startupKey.Close();
}
}
else
{
startupKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(runKey, true);
startupKey.DeleteValue(AppName, false);
startupKey.Close();
}
}
Run Code Online (Sandbox Code Playgroud)
有用.但我想让程序最小化(仅在Windows启动时).我没有找到工作代码/很好的解释如何做到这一点.你能帮我吗?
谢谢.
我正在尝试在我的Facebook网站壁纸页面上发布流.
到目前为止,我成功通过我的APP页面发布流,但我不希望通过,我想直接发布.
正如我之前所说,我想在我的Facebook网站壁纸页面上发布,而不是在应用程序墙页面上发布.
我找不到任何有用的东西......我也想用PHP发布,如果可能的话......如果不可能,我想我将不得不使用js.无论如何我该怎么做?
我有一个滑块,其最大视频时间值以秒为单位(1分钟= 60秒,因此如果视频长度为60秒,则滑块的最大值将为60).
当我拖动Thumb时,会有ThumbTooltip显示我正在悬停的当前值.
我想改变那个文本,而不是显示int,它将显示时间1将是00:01等等...
我试着玩滑块的风格没有运气.
非常感谢您的帮助.
我正在使用它:通过其句柄获取窗口的标题:
[DllImport("user32.dll")] private static extern int GetWindowText(int hWnd, StringBuilder title, int size);
StringBuilder title = new StringBuilder(256);
GetWindowText(hWnd, title, 256);
Run Code Online (Sandbox Code Playgroud)
如果标题有希伯来字符,则用问号代替它们.
我想问题与经济或某事有关......我该如何解决?
编辑:
如果相反的日期,我需要描述?(我应该使用段落,并且验证段落不能成为锚点,因为段落是块级别)
编辑结束
我相信通过阅读标题你不明白我想要什么.
我不确定如何写一个句子来概括我的问题.
所以,这是我的问题:
我在其中有3个不同的东西锚点>图标,标题和日期.每个都在不同的范围内.
我不知道它是否是正确的方法.
<ul id="m-items">
<li>
<a href="/post.php?name=ahf-_" class="m-item-header clear">
<span class="m-item-icon"></span>
<span class="m-item-title">ah%f#-$%^&()_!</span>
<span class="m-item-date">17 Feb 2013</span>
</a>
</li>
<li>
<a href="/post.php?name=d-3" class="m-item-header clear">
<span class="m-item-icon"></span>
<span class="m-item-title">d-3</span>
<span class="m-item-date">16 Feb 2013</span>
</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我有另一种方法来做,我认为这是正确的方法,但我不确定...
我的第二种方法是使用div有两个元素,锚和另一个包含文本的div.
每个人都处于绝对的位置.
<ul id="m-items">
<li>
<div class="m-item-header">
<a href="/post.php?name=ahf-_"></a>
<div class="m-item-header-content clear">
<div class="m-item-icon"></div>
<div class="m-item-title">ah%f#-$%^&()_!</div>
<div class="m-item-date">17 Feb 2013</div>
</div>
</div>
</li>
<li>
<div class="m-item-header">
<a href="/post.php?name=d-3"></a>
<div class="m-item-header-content clear">
<div class="m-item-icon"></div>
<span class="m-item-title">d-3</span>
<span class="m-item-date">16 …Run Code Online (Sandbox Code Playgroud) 我有一个脚本调整图像大小,然后保存新图像.
如果原始图像没有777权限,则无法保存新图像.
我知道777是有风险的,所以当使用不同的权限,如775或755时,它什么都不做.
编辑:
我希望能够使用我的脚本保存文件,无论图像的权限是什么.
我正在尝试将图像源设置为来自我的计算机(而不是资源).
这就是我试图这样做的方式:
Uri uri = new Uri(@"D:\Riot Games\about.png", UriKind.Absolute);
ImageSource imgSource = new BitmapImage(uri);
this.image1.Source = imgSource;
Run Code Online (Sandbox Code Playgroud)
我尝试了几乎所有我能在互联网上找到的东西,但似乎没什么用.
知道为什么吗?
XAML:
<UserControl
x:Class="App11.VideoPreview"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App11"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="250"
d:DesignWidth="250">
<Grid>
<Button Height="250" Width="250" Padding="0" BorderThickness="0">
<StackPanel>
<Image Name="image1" Height="250" Width="250"/>
<Grid Margin="0,-74,0,0">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="0.75">
<GradientStop Color="Black"/>
<GradientStop Color="#FF5B5B5B" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock x:Name="textBox1" TextWrapping="Wrap" Text="test" FlowDirection="RightToLeft" Foreground="White" Padding="5"/>
</Grid>
</StackPanel>
</Button>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud) 我想要覆盖它ContextMenu的风格.
这是我的风格:
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="#E7E8EC" />
<SolidColorBrush x:Key="SolidBorderBrush" Color="#CCCEDB" />
<Color x:Key="DropShadowColor">#808080</Color>
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border Name="Border" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" >
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
<Border.Effect>
<DropShadowEffect Color="{StaticResource DropShadowColor}" Opacity="0.60" ShadowDepth="4"/>
</Border.Effect>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么,但阴影不起作用(我看不到阴影).
我该如何解决?
我想得到PlotArea的宽度和高度,以便计算比例.我曾经ActiveChart.PlotArea.Width获得宽度,然后使用Photoshop测试宽度.
我发现返回的宽度ActiveChart.PlotArea.Width是错误的.
图像显示了我在说什么:

我不知道为什么...
请帮助我理解它为什么会发生以及如何解决它...
谢谢!
我有一个Button和一个ContextMenu属于的Button.
这是xaml:
<Button x:Name="ListBoxButton" Content="6" Style="{DynamicResource TabControlButton}">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="tst1"></MenuItem>
<MenuItem Header="tst2"></MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
Run Code Online (Sandbox Code Playgroud)
我希望在这篇文章中将我的ContextMenu与图像#2完全相同,
我希望使用xaml来实现它而不是代码隐藏.
我不可能实现它,我试图用玩PlacementTarget,HorizontalOffset,VeritcalOffset和Placement的性能ContextMenu,但它并没有对齐,我想..