This is the 18th article in the series "Developing smartphone software using C #: Pushing Chests". In this post. Describes the Window/selectleveldlg.cs source program files.
This source program file includes the Selectleveldlg class, which inherits from the System.Windows.Forms.Form class. Represents the Select Off dialog box for a push box. For example, as seen in:
The following is a partial code for the source program of Window/selectleveldlg.designer.cs:
namespaceSkyiv.Ben.PushBox.Window
{
PartialclassSelectleveldlg
{
//some code is omitted here.
PrivateSystem.Windows.Forms.NumericUpDown Nudmain;
PrivateSystem.Windows.Forms.Button Btnok;
PrivateSystem.Windows.Forms.Button Btncancel;
PrivateSystem.Windows.Forms.Label lblmsg;
PrivateSystem.Windows.Forms.Label Label2;
}
}
The following is the source code for SelectLevelDlg.cs:
1 usingSystem;
2usingSystem.Windows.Forms;
3
4namespaceSkyiv.Ben.PushBox.Window
5{
6 /// <summary>
7 ///the Select Off dialog box
8 /// </summary>
9 PublicPartialclassSelectleveldlg:form
Ten {
One Public intMaxlevel {Set{nudmain.maximum=value;} }
A Public intLevel {Get { return (int) Nudmain.value- 1; } Set{Nudmain.value=value+ 1; } }
-
- PublicSelectleveldlg (BOOListopmost)
the {
-InitializeComponent ();
-topmost=Istopmost;
- }
+
- protected Override voidOnLoad (EventArgs e)
+ {
A Base. OnLoad (e);
atLblmsg.text+=nudMain.Maximum.ToString ();
- }
- }
-}
Developing smartphone software using C #: Push Chests (18)