This is "using C # To develop smartphone software: Push box"
Series Article 15th. This article introduces the Windows/optiondlg. Cs SOURCE Program File. This source program file contains optiondlg
Class, which inherits from the system. Windows. Forms. Form class, indicating the "option" dialog box of the push box. As shown in:
The following is the source program of window/optiondlg. Designer. CS.Code:
Namespace Skyiv. Ben. pushbox. Window
{
Partial Class Optiondlg
{
// Some code is omitted here
Private System. Windows. Forms. Button btnok;
Private System. Windows. Forms. Button btncancel;
Private System. Windows. Forms. Label label1;
Private System. Windows. Forms. trackbar tkbstepspeed;
Private System. Windows. Forms. checkbox chksave;
Private System. Windows. Forms. Label label2;
Private System. Windows. Forms. trackbar tkbreplayspeed;
Private System. Windows. Forms. Label label3;
Private System. Windows. Forms. numericupdown nudmaxlevelsize;
Private System. Windows. Forms. textbox tbxstepspeed;
Private System. Windows. Forms. textbox tbxreplayspeed;
Private System. Windows. Forms. Label label4;
Private System. Windows. Forms. Label label5;
}
}
The following is the source code of optiondlg. CS:
1 Using System;
2 Using System. Windows. forms;
3 Using Skyiv. Ben. pushbox. Common;
4
5 Namespace Skyiv. Ben. pushbox. Window
6 {
7 /// <Summary>
8 /// "Option" dialog box
9 /// </Summary>
10 Public Partial Class Optiondlg: Form
11 {
12 Public Bool Issave { Get { Return Chksave. Checked ;} Set {Chksave. Checked = Value ;}}
13 Public Int Maxlevelsize { Get { Return ( Int ) Nudmaxlevelsize. value ;} Set {Nudmaxlevelsize. Value = Value ;}}
14
15 Public Int Stepdelay
16 {
17 Get
18 {
19 Return Pub. maxdelay - Tkbstepspeed. value;
20 }
21 Set
22 {
23 Tkbstepspeed. Maximum = Pub. maxdelay;
24 Tkbstepspeed. tickfrequency = Tkbstepspeed. largechange = 100 ;
25 Tkbstepspeed. Value = Pub. maxdelay - Value;
26 }
27 }
28
29 Public Int Replaydelay
30 {
31 Get
32 {
33 Return Pub. maxdelay - Tkbreplayspeed. value;
34 }
35 Set
36 {
37 Tkbreplayspeed. Maximum = Pub. maxdelay;
38 Tkbreplayspeed. tickfrequency = Tkbreplayspeed. largechange = 100 ;
39 Tkbreplayspeed. Value = Pub. maxdelay - Value;
40 }
41 }
42
43 Public Optiondlg ( Bool Istopmost)
44 {
45 Initializecomponent ();
46 Topmost = Istopmost;
47 }
48
49 Private Void Tkbstepspeed_valuechanged ( Object Sender, eventargs E)
50 {
51 Tbxstepspeed. Text = Stepdelay. tostring ();
52 }
53
54 Private Void Tkbreplayspeed_valuechanged ( Object Sender, eventargs E)
55 {
56 Tbxreplayspeed. Text = Replaydelay. tostring ();
57 }
58 }
59 }
The code for this class is very simple and I will not explain it much. She is only a user interface. The actual work is completed in the skyiv. Ben. pushbox. Common. configfile class. For details, see "using C # To develop a smartphone: Push box (9 )".
Previous Article: Using C # To develop smartphone software: Push box (14th)
Next article: use C # To develop the smartphone software: Push box (16)
Returned directory