我正在研究wpf应用程序,我想修复窗口的高度和宽度.我正在使用Metro风格,所以我不能使用FormBorderStyle的正常性.我尝试使用MaxWidth和MaxHeigth(MinWidth和MinHeigth),但是当我执行代码时会出现黑色边框
这是代码
<Controls:MetroWindow x:Class="Selen.Wpf.DemoApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:System="clr-namespace:System;assembly=mscorlib" Title="A propos "
MaxHeight="400" MaxWidth="550" MinHeight="400" MinWidth="550" WindowStartupLocation="CenterScreen" TitleForeground="#999988" Background="Black"
WindowStyle="None" ShowMaxRestoreButton="False" SizeToContent="WidthAndHeight" >
<Grid Background="#FF2D2D30" >
<TabControl Width="653">
<TabItem Header="Projet">
<Grid Background="#FF2D2D30" Margin="0,0,-7,0">
<TextBlock x:Name="text" Foreground="Green" TextDecorations="Underline" FontSize="16" Text="Modélidation d'une surface Topographique en 2D et 3D" Margin="10,10,204,0" Height="60" VerticalAlignment="Top" HorizontalAlignment="Center" Width="446" />
<TextBlock x:Name="text1" Foreground="White" FontSize="14" Margin="6,75,0,196" HorizontalAlignment="Left" Text="Le domaine de Sig a connu une grande developpement , 
 maintenant il est utilisé dans le domaine 
 de topographie pour définir …Run Code Online (Sandbox Code Playgroud) 我使用超级管理员创建了一个新的电子邮件配置文件,并配置了 smtp。
然后当我执行这个查询时:
exec msdb.dbo.sp_send_dbmail
@profile_name ='admin_mail',
@recipients = 'firstname.lastname@email.com',
@execute_query_database = 'DashboardPowerBi',
@query = 'select top 20 from Client_1',
@subject= 'Liste des clients',
@body_format ='HTML',
@attach_query_result_as_file = 1;
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
无法初始化 sqlcmd 库,错误号为 -2147024809
我正在研究一个wpf应用程序,我想得到文本框的值我想使用KeyDown和KeyPress来检查文本是否是一个数值但是当我写KeyPress时,编译器强调了这一点,所以我不能使用它.
private void sb_KeyDown_1(object sender, System.Windows.Input.KeyEventArgs e)
{
nonNumberEntered = false;
// Determine whether the keystroke is a number from the top of the keyboard.
if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
{
// Determine whether the keystroke is a number from the keypad.
if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
{
// Determine whether the keystroke is a backspace.
if (e.KeyCode != Keys.Back)
{
// A non-numerical keystroke was pressed.
// Set the flag to true and …Run Code Online (Sandbox Code Playgroud)