zoukankan      html  css  js  c++  java
  • WPF 透明背景窗体

    <Window x:Class="WpfApplication8.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" AllowsTransparency="True"
            Background="Transparent" WindowStyle="None" BorderThickness="0" MouseLeftButtonDown="Window_MouseLeftButtonDown"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Border Background="Pink"  BorderThickness="5" BorderBrush="Beige" Margin="0,0,409,0"></Border>
    
            <Border Background="#8CFDFDFD" BorderThickness="1" HorizontalAlignment="Center" BorderBrush="WhiteSmoke" Margin="2,0,2,23" MinHeight="55" MinWidth="22" MaxWidth="222" VerticalAlignment="Bottom">
                <Border.Effect>
                    <DropShadowEffect Color="#70FAEBD7" />
                </Border.Effect>
                    <Grid>
                    <TextBlock Name="txt" Padding="12" VerticalAlignment="Center" FontSize="14"  FontWeight="Bold" Foreground="#FFFF8888" TextWrapping="Wrap" Text="-----">
                        <TextBlock.Effect>
                             <DropShadowEffect Color="#70FFFFFF" />
                        </TextBlock.Effect>
                    </TextBlock>
                </Grid>
            </Border>
    
    
    
        </Grid>
    </Window>
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    
    namespace WpfApplication8
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
                work();
            }
    
            private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                DragMove();
            }
    
    
           void work() {
    
                 Task.Run(() => {
                    while (true)
                    {
    
                        Dispatcher.Invoke(() =>
                        {
    
                            txt.Text = "梵蒂冈冈梵蒂冈法定" + DateTime.Now;
    
                        });
    
                        Thread.Sleep(1000);
                    }
    
                
                });
            
            
            }
    
        }
    }
    

      

  • 相关阅读:
    SQL Server 2008 数据库回滚到某个时间点
    SQL Server 2008以上误操作数据库恢复方法——日志尾部备份
    C# BindingSource
    何谓SQL Server参数嗅探
    mongodb获取具体某一天的查询语句
    给MongoDB添加索引
    MongoDB 学习笔记四 C#调用MongoDB
    Access MongoDB Data with Entity Framework 6
    Ruby 和 OpenSSL CA 证书的问题
    解决方法:配置群集时# gem install redis 报错:Unable to require openssl, install OpenSSL and rebuild ruby
  • 原文地址:https://www.cnblogs.com/wgscd/p/12167472.html
Copyright © 2011-2022 走看看