close
MyToolkit新增一個專案
選擇<Windows Form控制項程式庫
加入一個Label元件
-
Set the BorderStyle to FixedSingle.
-
Set the Text to the digit 0 (zero).
-
Set the Autosize to False.
-
Set the Size to 30, 20.
-
Set the TextAlign to MiddleCenter.
label1 加入Click事件
1: private void label1_Click(object sender, EventArgs e)
2: {3: int temp = System.Int32.Parse(label1.Text);
4: temp++; 5: label1.Text = temp.ToString(); 6: }加入ClickAnyWhere
1: public bool ClickAnyWhere
2: { 3: get 4: {5: return (label1.Dock == DockStyle.Fill);
6: } 7: set 8: {9: if (value)
10: label1.Dock = DockStyle.Fill;11: else
12: label1.Dock = DockStyle.None; 13: } 14: }------------------------------------------------------------------------------------------------------------
撰寫一個Client端 UI測試上面windows form control元件
加入參考
加入一個<自訂>的標籤頁面
並且在<自訂>工具箱加入剛才開發的window form control元件
點選.net framework元件頁面
加入WinFormControlEx.dll控制元件
加入兩個元件
1: private void Form1_Load(object sender, EventArgs e)
2: {3: userControl11.ClickAnyWhere = true;
4: userControl12.ClickAnyWhere = false;
5: }編譯成功下, 點選label數值自動累加
參考資料:
全站熱搜
















留言列表
