You can use the toast notification in winform poject under win 8. I create a winform project, add a button by clicking the button, a toast notification will appear in the upper right corner of the window. The following is what I did.
First you need to open the win 8 platform by modifying the cspoj file (closed by default in the winform project) so that you can add the "Windows" link.
In projects on the desktop, the Core tab is not displayed by default. You can add Windows Runtime by right-clicking on a project in Solution Explore, selecting Unload Project, adding the following snippet, and reopening the project (right-click the project "Update Project"). When you open the Reference Manager dialog box, the Core tab appears. Then you can add the "Windows" link to the project.
<PropertyGroup> <TargetPlatformVersion>8.0</TargetPlatformVersion> </PropertyGroup>
For more information, you can refer to this link (near the end of the page)
Second, add the System.Runtime link.
Manually add the dll to "C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5 \ Facades \ System.Runtime.dll" (right-click the link, add the link, Browse)
Third, add a toast notification (you can add these codes to the event with the button pressed)
This part of the codes you can refer to this link Notes. If you want to show only toasts, you do not need to worry about ShellHelpers.cs. Or if you want, you can simply copy the codes below. You may need to add some of them accordingly, and maybe the image, if it doesnβt already, can still work. Oh, you also need to set APP_ID (just a constant string to represent uniqueness).
private const String APP_ID = "Microsoft.Samples.DesktopToastsSample"; using Windows.UI.Notifications; using Windows.Data.Xml.Dom; using System.IO;
Jensen
source share