• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

夏乐

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

随笔分类 -  WPF

C#策略模式
摘要://策略模式:/* * 1.定义接口 * 2.接口实现方法(class 方法名 :接口),里面可以有多个方法 * 3.使用方法 class 方法名{ public 方法名(接口名1 定义接口名1, 接口名2 定义接口名2, 接口名2 定义接口名3) * {this.GetMisplay = GetM 阅读全文

posted @ 2024-05-30 11:19 夏乐 阅读(36) 评论(0) 推荐(0)

wpf datagrid根据多选选中的获取单元格内容,进行操作数据
摘要:private void Button_Click(object sender, RoutedEventArgs e) { var vLst = this.dgList.SelectedItems; for (int i = 0; i < vLst.Count; i++) { 1.//获取选中的数据 阅读全文

posted @ 2019-08-27 09:59 夏乐 阅读(1078) 评论(0) 推荐(0)

WPF DataGrid获取单元格
摘要:WPF与WinForm获取单元格方式不同,需要as强制转换 单元格类型 1.区别 (1)WinForm string str = (string)dataGrid.Rows[0].Cells[0].Value; string str = (string)dataGrid.Rows[0].Cells[ 阅读全文

posted @ 2019-08-27 09:21 夏乐 阅读(2137) 评论(0) 推荐(1)

在WPF中使用多线程更新UI
摘要:在WPF中使用多线程更新UI 有经验的程序员们都知道:不能在UI线程上进行耗时操作,那样会造成界面卡顿,如下就是一个简单的示例: public partial class MainWindow : Window { public MainWindow() { InitializeComponent( 阅读全文

posted @ 2019-07-06 13:58 夏乐 阅读(659) 评论(0) 推荐(0)

WPF中自动定时刷新
摘要:wpf第一次用,为了定时刷新这个页面,也是费了我老大的功夫了,皇天不负有心人,最终还是给它弄出来了,话不多说,直接上代码。 //定时器 private System.Timers.Timer timerNotice = null; //定时刷新页面 private void TimeRefresh_ 阅读全文

posted @ 2019-06-08 09:20 夏乐 阅读(2111) 评论(0) 推荐(0)

DataGrid自定义样式
该文被密码保护。

posted @ 2019-06-05 21:39 夏乐 阅读(1) 评论(0) 推荐(0)

WPF 委托
摘要:子窗体调用主窗体事件: 主窗体: UserControl1 uc = new UserControl1();//用户控件窗体 uc.Up += new UpHandler(Up);//【2】委托声明(给子窗体操作调用的) temptb.Content = uc; 子窗体: 交互逻辑层外定义 //【1 阅读全文

posted @ 2019-06-04 14:54 夏乐 阅读(2691) 评论(0) 推荐(0)

日期时间
摘要:C#获取当前日期时间 C#获取当前日期时间 C#获取当前日期时间 C#获取当前日期时间 我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10 阅读全文

posted @ 2019-05-15 11:47 夏乐 阅读(160) 评论(0) 推荐(0)

 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3