using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace MatteKalkylatorn { // Last modified: 2002-07-27 // Version: 0.42 ID:LAJ44003 // Compiles with Microsoft Visual C# .NET 7.0.9466 on Windows 95. // The source code is free. It is not under any kind of license. // If this code works, it was written by Lars Johansson, Göteborg. // If not, I don't know who wrote it. /// /// Summary description for AvaliableFunctions. /// public class NumberOfDecimals : System.Windows.Forms.Form { private System.Windows.Forms.Label label6; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; private Laj.Controls.TextBoxNumberSpin textBoxNumberSpin1; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public NumberOfDecimals() { InitializeComponent(); } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.label6 = new System.Windows.Forms.Label(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.textBoxNumberSpin1 = new Laj.Controls.TextBoxNumberSpin(); this.SuspendLayout(); // // label6 // this.label6.Location = new System.Drawing.Point(8, 8); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(64, 16); this.label6.TabIndex = 13; this.label6.Text = "# Decimals"; // // buttonOK // this.buttonOK.Location = new System.Drawing.Point(80, 8); this.buttonOK.Name = "buttonOK"; this.buttonOK.TabIndex = 14; this.buttonOK.Text = "OK"; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // // buttonCancel // this.buttonCancel.Location = new System.Drawing.Point(80, 32); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.TabIndex = 15; this.buttonCancel.Text = "Cancel"; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // textBoxNumberSpin1 // this.textBoxNumberSpin1.AcceptEmptyBox = false; this.textBoxNumberSpin1.CheckLowerLimit = true; this.textBoxNumberSpin1.CheckUpperLimit = false; this.textBoxNumberSpin1.EditColor = System.Drawing.SystemColors.HotTrack; this.textBoxNumberSpin1.EnterKeySendsNumberChanged = false; this.textBoxNumberSpin1.LargeIncrement = new System.Decimal(new int[] { 10, 0, 0, 0}); this.textBoxNumberSpin1.Location = new System.Drawing.Point(8, 32); this.textBoxNumberSpin1.LowerLimit = new System.Decimal(new int[] { 0, 0, 0, 0}); this.textBoxNumberSpin1.Name = "textBoxNumberSpin1"; this.textBoxNumberSpin1.Number = 2; this.textBoxNumberSpin1.NumberDecimal = new System.Decimal(new int[] { 2, 0, 0, 0}); this.textBoxNumberSpin1.NumberDecimalDigits = 0; this.textBoxNumberSpin1.RoundToNumberDecimalDigits = true; this.textBoxNumberSpin1.ShowLimitsInToolTip = true; this.textBoxNumberSpin1.Size = new System.Drawing.Size(48, 20); this.textBoxNumberSpin1.SmallIncrement = new System.Decimal(new int[] { 1, 0, 0, 0}); this.textBoxNumberSpin1.TabIndex = 16; this.textBoxNumberSpin1.TakeLimits = false; this.textBoxNumberSpin1.UnitText = ""; this.textBoxNumberSpin1.UpperLimit = new System.Decimal(new int[] { 100, 0, 0, 0}); // // NumberOfDecimals // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(160, 61); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.textBoxNumberSpin1, this.buttonCancel, this.buttonOK, this.label6}); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "NumberOfDecimals"; this.Text = "Number Of Decimals"; this.ResumeLayout(false); } #endregion int numberDecimalsOrig; public int UpdateNumberOfDecimalsModal(int numberDecimals) { numberDecimalsOrig = numberDecimals; textBoxNumberSpin1.Number = numberDecimals; this.ShowDialog(); return numberDecimalsOrig; } private void buttonOK_Click(object sender, System.EventArgs e) { numberDecimalsOrig = (int)textBoxNumberSpin1.Number; this.Close(); } private void buttonCancel_Click(object sender, System.EventArgs e) { this.Close(); } } }