wpf

C# disable aero snap for WPF window [duplicate]

我们两清 提交于 2021-02-19 04:18:15
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: disable Aero Snap (wpf) I have an application in C# WPF. I want the main window to have fixed size. To achieve this, I have set the height and max height, width and max width, to the same values. Everything looks fine, but I want also to disable Aero snap effect for this window only. The solution to disable Aero snap from Windows Registry or Control Panel is excluded. Setting the ResizeMode of the window to

Multiple keys with WPF KeyDown event

僤鯓⒐⒋嵵緔 提交于 2021-02-19 04:16:06
问题 I'm working with WPF KeyDown event (KeyEventArgs from Windows.Input). I need to recognize when user pressed F1 alone and Ctrl+F1. private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key==Key.F1 && Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("ctrlF1"); } if (e.Key == Key.F1 && !Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("F1"); } } My problem is that when I press Ctrl+F1 plain F1 messagebox would fire too. I tried to add e.Handled to Ctrl+F1 case, but it doesn't

Multiple keys with WPF KeyDown event

对着背影说爱祢 提交于 2021-02-19 04:12:20
问题 I'm working with WPF KeyDown event (KeyEventArgs from Windows.Input). I need to recognize when user pressed F1 alone and Ctrl+F1. private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key==Key.F1 && Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("ctrlF1"); } if (e.Key == Key.F1 && !Keyboard.IsKeyDown(Key.LeftCtrl)) { MessageBox.Show("F1"); } } My problem is that when I press Ctrl+F1 plain F1 messagebox would fire too. I tried to add e.Handled to Ctrl+F1 case, but it doesn't

WPF : Can BinaryFormatter serialize FlowDocument instance?

*爱你&永不变心* 提交于 2021-02-19 03:37:28
问题 I like to using binaryformatter to serializing flow document. but it makes exception. [Serializable] public class BinFlow { public FlowDocument my { get; set; } } BinFlow myBF = new BinFlow(); myBF.my = myFlowDocument; FileStream myFile = File.Create(@"d:\test.bin"); BinaryFormatter myBinaryFormat = new BinaryFormatter(); //exception occured here!! myBinaryFormat.Serialize(myFile, myBF); Exception message said "FlowDocument does not decared 'Serializable' proeprty". ps. Of cause, I can use

Caliburn Launch without App.xaml, but with bootstrapper

感情迁移 提交于 2021-02-19 03:36:21
问题 I have a WinForms project from which I want to open a WPF window from a WPF user control project. But when I create an instance of the WPF window and call Show(), the bootstrapper isn't loaded. In an Windows Application, it's located in the App.xaml, but an user control project doesn't have this. What can I do? Thanks! 回答1: The only thing accomplished by having the bootstrapper in App.xaml's resources is instantiation of the bootstrapper and keeping a reference so it isn't garbage-collected.

How to detect when a WPF control has been redrawn?

China☆狼群 提交于 2021-02-19 03:34:04
问题 I am using D3DImage to display a sequence of frames that are rendered unto the same Direct3D Surface one after the other. My current logic is thus: Display last rendered frame (i.e.D3DImage.Lock()/AddDirtyRect()/Unlock()) Start rendering next frame Wait for next frame to be ready and that it's time to display it Display last rendered frame ... The problem with this approach is that when we are done calling Unlock() on D3DImage, the image isn't actually copied, it's only scheduled to be copied

How to detect when a WPF control has been redrawn?

丶灬走出姿态 提交于 2021-02-19 03:33:09
问题 I am using D3DImage to display a sequence of frames that are rendered unto the same Direct3D Surface one after the other. My current logic is thus: Display last rendered frame (i.e.D3DImage.Lock()/AddDirtyRect()/Unlock()) Start rendering next frame Wait for next frame to be ready and that it's time to display it Display last rendered frame ... The problem with this approach is that when we are done calling Unlock() on D3DImage, the image isn't actually copied, it's only scheduled to be copied

change the children index of stackpanel in wpf [closed]

前提是你 提交于 2021-02-19 03:23:08
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I want to know how I can change the children index of a StackPanel in c# code . For example, I want to make the child that is currently second to be displayed first. I need animation when changing the index. I am

DataGridTemplateColumn Column Span in DataGrid WPF

点点圈 提交于 2021-02-19 03:05:41
问题 I am making UI as shown in picture below. It is a DataGrid, Itemsource is bound to a List. I cannot set ColumnSpan for the TextBox . First, I tried it with a UserControl but I couldn't fix DataGridTemplateColumn Header, then I tried DataGridTemplateColumn.CellTemplate but couldn't set the ColumnSpan . Is there any way/method to make this kind of Datagrid? Thank you in advance. 回答1: There is no ColumnSpan in the DataGrid , like in the normal Grid . To get this kind of layout you have 3 choices

DataGridTemplateColumn Column Span in DataGrid WPF

纵然是瞬间 提交于 2021-02-19 03:05:11
问题 I am making UI as shown in picture below. It is a DataGrid, Itemsource is bound to a List. I cannot set ColumnSpan for the TextBox . First, I tried it with a UserControl but I couldn't fix DataGridTemplateColumn Header, then I tried DataGridTemplateColumn.CellTemplate but couldn't set the ColumnSpan . Is there any way/method to make this kind of Datagrid? Thank you in advance. 回答1: There is no ColumnSpan in the DataGrid , like in the normal Grid . To get this kind of layout you have 3 choices