2 using System.Collections;
3 using System.Collections.Generic;
7 using System.Threading.Tasks;
9 using System.Windows.Controls;
10 using System.Windows.Forms;
11 using System.Windows.Input;
12 using System.Windows.Media;
13 using System.Windows.Shapes;
23 System.Windows.Controls.TextBox
textBox =
new System.Windows.Controls.TextBox();
29 ArrayList ret =
new ArrayList();
32 System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
33 System.IO.Stream myStream = myAssembly.GetManifestResourceStream(
"ShapeLib.icons.text.png");
34 ui.
image =
new System.Drawing.Bitmap(myStream);
50 public override void MouseDownInsert(
object sender, System.Windows.Input.MouseButtonEventArgs e)
53 base.MouseDownInsert(sender, e);
62 TextBlock textBlock =
new TextBlock();
63 textBlock.Foreground =
new SolidColorBrush(System.Windows.Media.Color.FromRgb(
r,
g,
b));
64 textBlock.Height =
textBox.Height;
65 textBlock.Width =
textBox.Width;
66 textBlock.FontSize = 10 + scale * 4;
68 Canvas.SetLeft(textBlock,
x);
69 Canvas.SetTop(textBlock,
y);
71 while (
txt.Contains(
@"\u" ))
73 int ind =
txt.IndexOf(
@"\u");
74 string s=
txt.Substring(ind, 6);
75 byte[] bytes =
new byte[2];
76 bytes[1] = Convert.ToByte(s.Substring(2, 2), 16);
77 bytes[0] = Convert.ToByte(s.Substring(4, 2), 16);
78 string result = Encoding.Unicode.GetString(bytes);
79 txt=
txt.Replace(s, result);
116 textBox.Foreground =
new SolidColorBrush(System.Windows.Media.Color.FromRgb(
r,
g,
b));
RibbonControlEventHandler click
System.Windows.Controls.TextBox textBox
string belong
判斷按下Button控制項
override void DrawShape(gView gv, gPath data, Boolean bfirst)
依data 繪製,如果是第一次畫要新建shape, 更新的話只要更新最後一點
override void MouseDownInsert(object sender, System.Windows.Input.MouseButtonEventArgs e)
某一類的形狀.包含UI 的界面,繪製方式.更新方式.新增方式
override System.Collections.ArrayList getMenuItem()
覆寫System.Collections.ArrayList
System.Windows.Point controlBtn1
void btn_Click(object sender, RibbonControlEventArgs e)
UI 點選
System.Windows.Controls.UserControl Root
System.Drawing.Image image