之前我曾經有用過Flash or 一些作法 來做幾本電子書.........
之前的SilverLight也有一個demo叫Page Turn也蠻炫的
不過今天才發現這本Pure WPF的Book Control
這本才真的比較棒~~ 翻頁不是四四角角的 而是有點柔軟的感覺
裡面可以放一大堆Control, 3D Object, Video, ...etc 應有盡有
而且還有Full Source
還真的不錯 值得一看....
Powered by ScribeFire.
Powered by ScribeFire.
void MakeButton()
{
Button b2 = new Button();
b2.AddHandler(Button.ClickEvent, new RoutedEventHandler(Onb2Click));
}
void Onb2Click(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}
The next example shows the C# operator syntax
(Microsoft Visual Basic .NET has slightly different operator syntax
because of its handling of indirection):
C# Method2-------------------------------------------------
void MakeButton2()
{
Button b2 = new Button();
b2.Click += new RoutedEventHandler(Onb2Click2);
}
void Onb2Click2(object sender, RoutedEventArgs e)
{
//logic to handle the Click event
}
Powered by ScribeFire.
Powered by ScribeFire.
Powered by ScribeFire.
using System;在下列程式碼中,示範了如何使用 PtrToStructure 方法,將記憶體的 Unmanaged 區塊封送處理成 Managed 結構。
using System.Runtime.InteropServices;
public struct Point
{
public int x;
public int y;
}
class Example
{
static void Main()
{
// Create a point struct.
Point p;
p.x = 1;
p.y = 1;
Console.WriteLine("The value of first point is " + p.x + " and " + p.y + ".");
// Initialize unmanged memory to hold the struct.
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(p));
try
{
// Copy the struct to unmanaged memory.
Marshal.StructureToPtr(p, pnt, false);
// Create another point.
Point anotherP;
// Set this Point to the value of the
// Point in unmanaged memory.
anotherP = (Point)Marshal.PtrToStructure(pnt, typeof(Point));
Console.WriteLine("The value of new point is " + anotherP.x + " and " + anotherP.y + ".");
}
finally
{
// Free the unmanaged memory.
Marshal.FreeHGlobal(pnt);
}
}
}
Powered by ScribeFire.