wpf 生成自己格式的窗口并且按钮横向排序
来源:互联网 发布:java socket 数据传输 编辑:程序博客网 时间:2024/06/05 20:35
<Window x:Class="MysherOCRReader.ChangeDistingWordOfSelected" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ChangeDistingWordOfSelected" Height="80" Width="140" MaxHeight="80" MaxWidth="140" WindowStyle="None" AllowsTransparency="True" Loaded="Window_Loaded" ShowInTaskbar="False"> <Grid> <StackPanel Name="sp1" Background="LightSlateGray"> <Border Name="cn_drage" Background="LightGray" Height="20"> <TextBlock x:Name="tishi" Text="请输入你要替换的字" HorizontalAlignment="Center" VerticalAlignment="Stretch" ></TextBlock> </Border> <TextBox Name="ChangedWord" Height="27" Margin="3" Width="100"></TextBox> <StackPanel x:Name="sp_select" HorizontalAlignment="Center" Orientation="Horizontal"> <Button x:Name="btn_ok" Content="确定" Width="55" Margin="5"></Button> <Button x:Name="btn_cancle" Content="取消" Width="55" Margin="5"></Button> </StackPanel> </StackPanel> </Grid></Window>
后台
using System;using System.Collections.Generic;using System.Linq;using System.Text;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.Shapes;namespace MysherOCRReader{ /// <summary> /// ChangeDistingWordOfSelected.xaml 的交互逻辑 /// </summary> public partial class ChangeDistingWordOfSelected : Window { private System.Threading.Mutex myMutex = null; public string strChange = string.Empty; public ChangeDistingWordOfSelected() { InitializeComponent(); GlobalHelper._ChangeDistingWord = this; this.btn_ok.Click += new RoutedEventHandler(btn_ok_Click); this.cn_drage.MouseLeftButtonDown += new MouseButtonEventHandler(cn_drage_MouseLeftButtonDown); this.btn_cancle.Click += new RoutedEventHandler(btn_cancle_Click); } //取消 void btn_cancle_Click(object sender, RoutedEventArgs e) { this.Close(); } //移动border void cn_drage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this.DragMove(); } //确定,没有在这里用 void btn_ok_Click(object sender, RoutedEventArgs e) { strChange = this.ChangedWord.Text; } /// <summary> /// 加载的时候判断是不是已经存在如果存在就不再生成了。 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Window_Loaded(object sender, RoutedEventArgs e) { string configs = string.Empty; //禁止同时打开2个 bool mutexIsNew = false; try { myMutex = new System.Threading.Mutex(true, configs, out mutexIsNew); } catch { } if (!mutexIsNew) { MessageBox.Show("22222"); this.Close(); } } }}
0 0
- wpf 生成自己格式的窗口并且按钮横向排序
- [WPF疑难]如何禁用窗口上的关闭按钮
- WPF中如何禁用/去除窗口右上角的关闭按钮
- WPF中如何禁用/去除窗口右上角的关闭按钮
- 窗口按钮不出现任务栏上,并且窗口风格保持原来的样式
- [WPF] WPF的按钮(Button)
- wpf改变默认的窗口边框大小,去掉边框,并且可以拖动大小
- javascript用window.open的子窗口关闭自己并且刷新父窗口
- 【JavaScript】Javascript用window.open的子窗口关闭自己并且刷新父窗口
- javascript用window.open的子窗口关闭自己并且刷新父窗口
- WPF的窗口
- WPF--窗口的属性
- 同一个窗口中不同的按钮控件使用同一个storyboard的方法(WPF)
- 一个按钮点击隐藏下面内容,再点击显示,并且按钮自己里边的字也在变
- 在java中取得当前的系统时间并且转化成自己想要的格式
- 在java中取得当前的系统时间并且转化成自己想要的格式
- 解析计算公式,然后生成自己想要的格式
- APK反编译并且用自己的keystore签名生成新的apk
- 使用Java、Servlet 生成二维码
- android 解析新浪微博json数据
- linux下标准编辑器vi及其升级版本vim的五个保存命令
- [记录]暂定为第十天吧
- 链表的普通应用
- wpf 生成自己格式的窗口并且按钮横向排序
- 孪生素数
- epoll使用详解(精髓)
- hdu 1028 Ignatius and the Princess III 【整数划分】
- 《剑指offer》练习
- get和set的作用
- 浅析线程及同步
- Asp.net动态页面静态化之include和parse区别
- 排序算法_C++(一)插入排序之直接插入排序