- 浏览: 204291 次
- 性别:
- 来自: 成都
最新评论
文章列表
<wfi:WindowsFormsHost>
<ElementHost>
<ScrollViewer Name="scrollViewer" Grid.Row="0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto" PreviewMouseDown="scrollVie ...
由于“Dameer”是在同一程序集中实现的,您必须设置 x:Name 特性而不是 Name 特性。
WindowsFormsHost的使用注意
- 博客分类:
- wpf学习
一使用
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会指定需要用
<wfi:WindowsFormsHost>
...
TextBox滚动条
- 博客分类:
- wpf学习
<TextBox Grid.Row="1" Name="txtContent" IsReadOnly="True" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility ="Auto" VerticalContentAlignment="Top" Margin="2,7,2,2"></TextBox>
TextBlock滚动条
- 博客分类:
- wpf学习
<ScrollViewer Name="scrollViewer">
<TextBlock TextWrapping="Wrap" ScrollViewer.VerticalScrollBarVisibility="Auto" Name="txtContent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ></TextBlock>
...
错误 1 “{DependencyProperty.UnsetValue}”不是 Setter 上“System.Windows.Controls.Border.BorderBrush”属性的有效值。
总结:WPF涉及到资源的嵌套引用,被引用的资源要定义在引用的资源前面
string格式的日期时间字符串转为DateTime类型
//方法二:DateTime.ParseExact()
string dateString = "20110526";
DateTime dt = DateTime.ParseExact(dateString, "yyyyMMdd",System.Globalization.CultureInfo.CurrentCulture);
//或者
DateTime dt = DateTime.ParseExact(dateString, "yyyyMMdd",System.G ...
private void CheckBox_Click(object sender, RoutedEventArgs e)
{
//lock (isSelectedIndexListLock)
//{
System.Windows.Controls.CheckBox dg = sender as System.Windows.Controls.CheckBox;
int iIndex = dataGridReserveCommisList.Sele ...
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
namespace Splash.WPF
{
public static class DataGridPlus
{
/// <summary>
/// 获取DataGrid控件单元格
/// </summary>
/// <param name="da ...
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--自定义DataGrid样式-->
<Style x:Key="CustomDataGrid" TargetType="DataGrid"> ...
x:Name x:Key Name区别
1、x:Key 只能在资源中;
="{StaticResource ResourceKey=FQCustomDataGrid}"
ResourceKey用的是key,不能是name
2、
<UserControl x:Class="WpfCtrlLib.Ui.QuotesCtrl.QuotesCard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats ...
int iCount = this.dataGridCancelOrderList.Items.Count;
for (int i = 0; i < iCount; i++)
{
var cntr = this.dataGridCancelOrderList.ItemContainerGenerator.ContainerFromIndex(i);
DataGridRow ObjROw = (DataGridRow)cntr;
...