|
|
|
.NET ขอแนวทางการเขียนโปรแกรมบนมือถือประเภท Smart Device Application (C#) |
|
|
|
|
|
|
|
Code (C#)
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace SmartDeviceProject
{
public partial class frmMain : Form
{
// By https://www.thaicreate.com (mr.win)//
public frmMain()
{
InitializeComponent();
}
private void btnHome_Click(object sender, EventArgs e)
{
frmHome f = new frmHome();
f.Show();
}
private void btnExit_Click(object sender, EventArgs e)
{
if(MessageBox.Show("Are you sure to exit?", "Confirm.", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
Application.Exit();
}
}
private readonly byte VK_OFF = 0xdf;
private readonly byte KEYEVENTF_KEYUP = 0x2;
[System.Runtime.InteropServices.DllImport("coredll.dll", SetLastError = true)]
public static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
private void btnShutdown_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure to shutdown?", "Confirm.", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
keybd_event(VK_OFF, 0, 0, 0);
keybd_event(VK_OFF, 0, KEYEVENTF_KEYUP, 0);
}
}
}
}
(C#) .NET Smart Device เขียนโปรแกรมบน Smartphone, Pocket PC , Windows CE , Window Mobile 5-6, Hand Held,
|
|
|
|
|
Date :
2011-06-06 21:44:18 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|