Introduction
this sample includes two functions,the first one can be used as notifications,the other one can change button and lable location and size.
First of all,we must add reference OpenNETCF.dll and OpenNETCF.Net.dll library,and then using OpenNETCF.Win32.Notify in your namespace.
Using the code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenNETCF.Win32.Notify;
namespace Notification
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
UserNotification notification = new UserNotification();
// notification.Action = NotificationAction.Sound;
notification.Action = NotificationAction.Dialog;
//notification.Action = NotificationAction.Vibrate;
notification.Title = "Title:Reminder";
notification.Text = "Content

on΄t forget to call John!";
Notify.SetUserNotification("", DateTime.Now, notification);
}
private void Form1_Resize(object sender, EventArgs e)
{
if (Screen.PrimaryScreen.Bounds.Width > Screen.PrimaryScreen.Bounds.Height)
{
Landscape();
}
else
{
Portrait();
}
}
protected void Portrait()
{
this.button1.Location = new System.Drawing.Point(88, 216);
this.button1.Size = new System.Drawing.Size(136, 16);
this.label1.Location = new System.Drawing.Point(100, 100);
this.label1.Size = new System.Drawing.Size(64, 16);
}
protected void Landscape()
{
this.button1.Location = new System.Drawing.Point(100, 100);
this.button1.Size = new System.Drawing.Size(136, 16);
this.label1.Location = new System.Drawing.Point(150, 50);
this.label1.Size = new System.Drawing.Size(64, 16);
}
}
}