I want to set a custom cursor within my WPF application. Originally I had a .png file, which i converted to .ico, but since I didn't find any way to set an .ico file as a cursor in WPF, I tried to do this with a proper .cur file.  I have created such an .cur file using Visual Studio 2013 (New Item -> Cursor File). The cursor is a coloured 24-bit image and its build-type is "Resource".  I accquire the resource stream with this:  var myCur = Application.GetResourceStream(new Uri("pack://application:,,,/mycur.cur")).Stream;   This code is able to retrieve the stream, so myCur is NOT  null aferwards.  When trying to create the cursor with  var cursor = new System.Windows.Input.Cursor(myCur);   the default cursor Cursors.None is returned and not my custom cursor. So there seems to be a problem with that.  Can anybody tell me why the .ctor has problems with my cursor stream? The file was created using VS2013 itself, so I'd assume that the .cur file is correctly formatted. Alternatively: If someone knows how to load a .ico file as a cursor in WPF, I'd be very happy and very grateful.  EDIT: Just tried the same with a fresh new .cur file from VS2013 (8bpp) in case adding a new palette has screwed the image format. Same result. The .ctor of System.Windows.Input.Cursor can't even create a proper cursor from the 'fresh' cursor file.
59772
I want to use an image or icon as a custom cursor in WPF app. What's the best way to do it?
39496
Since I've installed Dawnguard and Hearthfire, when ever I do an Alt-Tab and come back to the game I get the windows cursor and the game cursor. And both are not sync over each other so it's kind of annoying. How can I fix this bug ?
29507
I have been running  over some C# code, and it keeps reporting that my using directives should be inside the namespace.  Is there a technical reason for putting the using directives inside instead of outside the namespace?
80278
I'm trying to get images to display in a WPF ListView styled like a WrapPanel as described in this old ATC Avalon Team article: .    When I try to populate the ListView with a LINQ-to-Entities queried collection of ADO.NET Entity Framework objects I get the following exception:  Exception     Items collection must be empty before   using ItemsSource.   My code&hellip;  Visual Basic  Private Sub Window1_Loaded(...) Handles MyBase.Loaded     ListViewImages.ItemsSource = From g In db.Graphic _                                  Order By g.DateAdded Ascending _                                  Select g End Sub   XAML  &lt;ListView Name="ListViewImages"           SelectionMode="Single"           ItemsSource="{Binding}"&gt;     &lt;local:ImageView /&gt; &lt;/ListView&gt;   I put a breakpoint on that line.  ListViewImages.ItemsSource is Nothing just before the LINQ assignment.
54354
Some, but not all, icons for UWP apps are not displaying in search or settings. They do, however, display on the start menu when not searching. Icons for all non UWP apps display correctly, every time. UWP app icons are always present on the taskbar.   UPDATE: Many locally stored image thumbnails fail to appear in start menu search results either, no matter what image format.  The reason I have posted this as a separate question from , is for the following differentiating reasons:   Not all UWP app icons fail to display The issue is specifically present on the start menu only during search UWP apps never fail to display their icons on the taskbar   I have tried:    Resetting the icon cache The solution  involving the windowsapps folder Creating a new user account Deleting iconstream registry keys Changing performance settings to save thumbnails Changing default app for PNGs Changing default app for all images in windows settings Changing windows explorer view settings Updating graphics drivers   Screenshots:
83956
Much as I like Unity and Gnome, getting global keyboard shortcuts and mouse clicks "right" is a source of continual frustration.  We have:   The "settings" dialogs for keyboard and mouse The ccsm tool with chainsaw-like ability to shred your system Unity tweaks (another obscure application) gconf-editor Kernel configuration to access consoles through Ctrl-Alt-Fx I don't know what else.   Recently, I tried to re-assign Super-L to lower a window rather than lock the screen for my 14.04 setup.  We already have Ctrl-Alt-L to lower the screen anyway, I don't need a second shortcut.  But after trying several tools to re-assign the key, I just gave up.  Several layers of assignment all implemented the "same" shortcut, but it isn't easy to figure out which one(s) are actually causing the system to respond as it is.  Without that information, it is hard to reconfigure.    This is a crazy-making setup that makes Linux harder to use than Windows for the average user: Too many arcane ways to set things up, and then a tangle of confusion trying to figure out why anything happens as it does.  How I long for the good old days of fvwm, the simple window manager that could assign any key or mouse click combination to do anything in any context, and the entire configuration was in a single .fvwmrc file! Using Fvwm as the only holder of system-wide shortcuts make life simple, but the multi-layer approach makes Microsoft's regedit seem simple!  It would be wonderful if there were a simple script that could search all the system and user-specific files for a keyword, and report where keypress and mouse-click events matching a pattern are configured.  Ideally, it would support a "universal" keypress and mouse-click description syntax or a GUI, and parse and match that in each of the many configuration files.  A bonus would be if the script could print out a suggestion how to manage the setting with the least potential for inadvertent misconfiguration (for example, helping the user avoid using ccsm when it isn't needed).
117894
Similar to the way Notepad++ adds "Edit with Notepad++" to the context menu of all files, or how most Antivirus products will add a global "Scan this file" option, I would like to add a particular program to the context menu for all file types.  Thanks to DOSBox, I'm a little familiar with manually creating file associations and creating context menu options for specific file types.    However, I've got one program I'd like to add as a context menu globally because it can be used with files that have almost any extension.  What registry keys do I need to modify for this, and what common pitfalls should I avoid in order to not break things here?  I'd rather do this manually, so that I'm intimately familiar with what changes I'm making to the system, rather than use a third-party tool.  The OS I'm doing this on is Windows 7 x64, but it would be great if the same method could be used all the way back to XP.  I can probably figure out the necessary command syntax myself - I just need to know which keys to go after and how to format the commands and labels to be properly recognized in those keys.
91216
Our project is running on Windows CE 6.0 and is written in C++ . We have some problems with the code , and we are unable to debug . We also found out that if in our application we create threads and try to printf from them , the output won't appear . The only output that will appear is the one from the main thread . I would like to do the following :   create a custom windows message use as it's WPARAM the address of a char* I want to show on the screen use as it's LPARAM the length of the char* I want to show on the screen send the message process it when it comes , so that it prints the char*   How could I create the custom windows message ? What are the types of WPARAM and LPARAM ? Is it possible to do what I just wrote ?  Thanks
80329
I have difficulties seeing, so I tried to change my cursor using the instructions from Ubuntu 11, 12 but nothing worked. I have found no one on this Internet with my problem. I run Ubuntu 14.04 and gnome 3.9, I have dconf-editer, compiz-config and they don't do anything to my computer.
31233
I'm trying to find out how to read/write to the extended file properties in C# e.g. Comment, Bit Rate, Date Accessed, Category etc that you can see in Windows explorer.  Any ideas how to do this? EDIT: I'll mainly be reading/writing to video files (AVI/DIVX/...)
77635
I need to set a dependency property on a control (Slider.Value) in my code without it triggering a ValueChanged event (since I set the value, not the user). What is the best way to handle this situation in WPF?   For clarification, what I am trying to do is hook up WPF sliders to a WinForms User Control. Currently in my app I have a ValueChanged event handler that passes the slider value to the WinForms control via a method call. The WinForms control (which is actually a wrapper around a native OpenGL window) needs to be able to dynamically change the slider based on it's internal calculations. To do this I use an abstraction of a slider (ISlider) , I instantiate a WPF-flavor of that slider in my app, and pass a handle to it's base to the WinForms control via a .NET property on the WinForms User Control. All of this is currently working, it's just that when the internal logic decides the slider needs to change, it calls ISlider::SetPos(), which then changes the WPF slider, which then triggers a ValueChanged event on the slider, and the handler for that event extracts the slider's position and passes it in to the WinForms control which originated the event in the first place. The suggestions by ligaz and Alan Le both seem like they should work, but I'm just not sure I'm going about this in the best way.
92393
I know how to create a custom user control in WPF but how can I make it so that someone can provide an ItemTemplate?  I have a user control that is a mixture of several other WPF controls, one of them being a ListBox. I'd like to let the user of the control specify the content of the list box but I'm not sure how to pass that information through.  EDIT: The accepted answer works with the following correction:  &lt;UserControl x:Class="WpfApplication6.MyControl"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:src="clr-namespace:WpfApplication6"&gt;     &lt;ListBox ItemTemplate="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type src:MyControl}}, Path=ItemsSource}" /&gt; &lt;/UserControl&gt;
34721
Related:    I've created my custom context menu item, and it seems to work on all file types - even through shortcut links.  (Selecting my custom option performs the operation on the shortcut target, not the .lnk file.)  Now, I'd like to create an icon to make it stand out.  My antivirus program and Notepad++ seem to have been able to do this, so I know it's possible.  The only question is, how?
71830
I'm working with a WinForm app in C#, after I type something in a textbox I want to hit the Enter key but the textbox still has focus (flashing cursor is still in textbox), how can I achieve this?
68219
What is the shortcut key for Run to cursor in Visual Studio 2008?
118399
I'm going to have to build a custom control for a WinForms application. But in the near future that same control will have to be used in a WPF application.  I've already written all the logic in a controller class which I can use for both WinForms and WPF (I will only have some databinding to do and that's it), but of course it would be easier to develop and maintain the control only once.  So can I build the control in WPF and then put them on a WinForms form? My projects currently have 3.0 as their target framework.
21719
I'm using some Images in my WPF applcation.  XAML:  &lt;Image Name="ImageOrderedList"        Source="images/OrderedList.png"        ToolTip="Ordered List"        Margin="0,0,5,5"        Width="20"        Height="20"        SnapsToDevicePixels="True"        MouseUp="Image_MouseUp"        MouseEnter="Image_MouseEnter"        MouseLeave="Image_MouseLeave" /&gt;   But, they appear fuzzy.  Why doesn't that SnapsToDevicePixels="True" line prevent this problem?