This is the 18th article in the series "Developing smartphone software using C #: Pushing Chests". In this article, the Window/selectleveldlg.cs source program files are introduced. This source program file contains the Selectleveldlg class, which inherits from the System.Windows.Forms.Form class, which represents the "Select Off" dialog box for the Push box. As shown in the following:
Here 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;
}
}
Here is the source code for SelectLevelDlg.cs:
1usingSystem;
2 usingSystem.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 ();
- }
- }
-}
Copyright NOTICE: This article for Bo Master http://www.zuiniusn.com original article, without Bo Master permission not reproduced.
Developing smart phone software using C #: Push Chests (18)