jcair的博客
jcair · 共 231 篇文章
wfi:WindowsFormsHost焦点设置
[code="java"] [/code] 添加鼠标点击 [code="java"] [/code] 2设置焦点 [code="java"] private void scrollViewer_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (Mgr.CurrFocusIn != Constant.FocusInTrade) { this.Focus(); Mgr.CurrFocusIn = Constant.FocusInTrade; } } [/code]
WindowsFormsHost的使用注意
一使用 1 引用 2 xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" 3 由于WindowsFormsHost会指定需要用 <.................> 包裹,且在最外层包裹 二 WindowsFormsHost鼠标事件响应 1 里面的控件可以响应,若使用Forms的控件注意使用System.W…
2016-04-25 10:24 · wpf学习 · 评论(0)
DependencyProperty.UnsetValue_WPF涉及到资源的嵌套引用,被引用的资源要定义在引用的资源前面
错误 1 “{DependencyProperty.UnsetValue}”不是 Setter 上“System.Windows.Controls.Border.BorderBrush”属性的有效值。 总结:WPF涉及到资源的嵌套引用,被引用的资源要定义在引用的资源前面
string格式的日期时间字符串转为DateTime类型
string格式的日期时间字符串转为DateTime类型 //方法二:DateTime.ParseExact() string dateString = "20110526"; DateTime dt = DateTime.ParseExact(dateString, "yyyyMMdd",System.Globalization.CultureInfo.CurrentCulture); //或者 DateTime dt = DateTime.ParseExact(dateString, "yyyyMMdd",System.Globalization.CultureInfo.Invarian…
2015-08-05 14:22 · c#学习 · 评论(0)
checkbox
private void CheckBox_Click(object sender, RoutedEventArgs e) { //lock (isSelectedIndexListLock) //{ System.Windows.Controls.CheckBox dg = sender as System.Windows.Controls.CheckBox; int iIndex = dataGridReserveCommisList.SelectedIndex; OrderFModel orderFModel = dataGridReserveCommisList.SelectedIt…
获取DataGridCell(转)
[code="c#"] using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Media; namespace Splash.WPF { public static class DataGridPlus { /// /// 获取DataGrid控件单元格 /// /// DataGrid控件 /// 单元格所在的行号 /// 单元格所在的列号 /// 指定的单元格 public static DataGridCell GetCell(this DataGrid…
2015-07-06 14:08 · 评论(0)
x:Name x:Key Name区别
x:Name x:Key Name区别 1、x:Key 只能在资源中; ="{StaticResource ResourceKey=FQCustomDataGrid}" ResourceKey用的是key,不能是name 2、
work_代码添加
[code="xaml"] [/code] [code="c#"] using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Globalization; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windo…
FindName和VisualTreeHelper
int iCount = this.dataGridCancelOrderList.Items.Count; for (int i = 0; i < iCount; i++) { var cntr = this.dataGridCancelOrderList.ItemContainerGenerator.ContainerFromIndex(i); DataGridRow ObjROw = (DataGridRow)cntr; if (ObjROw != null) { DataGridTemplateColumn templeColumn = dataGridCancelOrderList…