摘要:今天想把listboxitem加上右键菜单,如下<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemLDPStyle}"> <Setter Property="ContextMenu"> <Setter.Value> <ContextMenu> <MenuItem Header="Header" Click="MenuItem_Cli...
阅读全文
摘要:不要忘记()要不就是UnsetValue 悲剧啊
阅读全文
摘要:窗口的AllowsTransparency不能为true,否则WinForm控件无显示WindowsFormsHost的父元素的父元素。。。。不能有背景,否则无显示。背景只能如下使用<Window> <Grid> <Border Background=""/> <WindowsFormsHost/> </Grid></Window>
阅读全文
摘要:<sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">width</sys:Double> <sys:Double x:Key="{x:Static SystemParameters.HorizontalScrollBarHeightKey}">height</sys:Double>样式字典中加入如上
阅读全文
摘要:1窗口大小的调整,这个应该不算啥技巧,就是头次使用长长记性窗口模板中有ResizeGrip,并在ResizeMode="CanResizeWithGrip"时显示2WindowStyle=None时自定义按钮关闭窗体方法一:在某个cs文件中创建类,把关闭写在cs中,这样代码是很丑方法二:最近项目中用了CaliburnMicro,使得关闭窗口简单起来在自定义的按钮上添加cm:Action.Target="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}&qu
阅读全文