diff --git a/RadixConvertPractice.v11.suo b/RadixConvertPractice.v11.suo index 795f5ee..698792f 100644 Binary files a/RadixConvertPractice.v11.suo and b/RadixConvertPractice.v11.suo differ diff --git a/RadixConvertPractice/Form1.Designer.cs b/RadixConvertPractice/Form1.Designer.cs index f07a7a6..7e4e860 100644 --- a/RadixConvertPractice/Form1.Designer.cs +++ b/RadixConvertPractice/Form1.Designer.cs @@ -47,20 +47,22 @@ private void InitializeComponent() { this.button1.BackColor = System.Drawing.Color.DarkRed; this.button1.Cursor = System.Windows.Forms.Cursors.Hand; this.button1.FlatAppearance.BorderColor = System.Drawing.SystemColors.ControlDark; + this.button1.FlatAppearance.BorderSize = 0; this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button1.Location = new System.Drawing.Point(294, 5); + this.button1.Font = new System.Drawing.Font("Marlett", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(2))); + this.button1.Location = new System.Drawing.Point(292, 10); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(33, 32); + this.button1.Size = new System.Drawing.Size(35, 26); this.button1.TabIndex = 0; this.button1.TabStop = false; - this.button1.Text = "X"; + this.button1.Text = "r"; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // // baseList // this.baseList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.baseList.Font = new System.Drawing.Font("Arial", 11.25F); this.baseList.FormattingEnabled = true; this.baseList.Items.AddRange(new object[] { "Binary - 2", @@ -69,25 +71,28 @@ private void InitializeComponent() { "Hexadecimal - 16"}); this.baseList.Location = new System.Drawing.Point(185, 65); this.baseList.Name = "baseList"; - this.baseList.Size = new System.Drawing.Size(130, 26); + this.baseList.Size = new System.Drawing.Size(130, 25); this.baseList.TabIndex = 1; this.baseList.SelectedIndexChanged += new System.EventHandler(this.comboBox_SelectedIndexChanged); // // label1 // this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(24, 68); + this.label1.Font = new System.Drawing.Font("Arial", 11.25F); + this.label1.Location = new System.Drawing.Point(25, 68); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(155, 18); + this.label1.Size = new System.Drawing.Size(155, 17); this.label1.TabIndex = 2; this.label1.Text = "Select a number base:"; + this.label1.Click += new System.EventHandler(this.label1_Click); + this.label1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormMove); // // answerButton // this.answerButton.Cursor = System.Windows.Forms.Cursors.Hand; this.answerButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.ControlDark; this.answerButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.answerButton.Font = new System.Drawing.Font("Arial", 11.25F); this.answerButton.Location = new System.Drawing.Point(28, 283); this.answerButton.Name = "answerButton"; this.answerButton.Size = new System.Drawing.Size(288, 28); @@ -99,49 +104,59 @@ private void InitializeComponent() { // label2 // this.label2.AutoSize = true; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(35, 118); + this.label2.Font = new System.Drawing.Font("Arial", 11.25F); + this.label2.Location = new System.Drawing.Point(36, 118); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(144, 18); + this.label2.Size = new System.Drawing.Size(144, 17); this.label2.TabIndex = 5; this.label2.Text = "Enter number length:"; + this.label2.Click += new System.EventHandler(this.label2_Click); + this.label2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormMove); // // lenTxb // + this.lenTxb.Font = new System.Drawing.Font("Arial", 11.25F); this.lenTxb.Location = new System.Drawing.Point(185, 115); this.lenTxb.Name = "lenTxb"; - this.lenTxb.Size = new System.Drawing.Size(130, 24); + this.lenTxb.Size = new System.Drawing.Size(130, 25); this.lenTxb.TabIndex = 6; + this.lenTxb.TextChanged += new System.EventHandler(this.lenTxb_TextChanged); // // genTextbox // + this.genTextbox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.genTextbox.Font = new System.Drawing.Font("Arial", 11.25F); this.genTextbox.Location = new System.Drawing.Point(27, 203); this.genTextbox.Name = "genTextbox"; - this.genTextbox.ReadOnly = true; - this.genTextbox.Size = new System.Drawing.Size(288, 24); + this.genTextbox.Size = new System.Drawing.Size(288, 25); this.genTextbox.TabIndex = 7; this.genTextbox.TabStop = false; this.genTextbox.Text = "See generated number here"; this.genTextbox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.genTextbox.TextChanged += new System.EventHandler(this.genTextbox_TextChanged); // // answerLabel // this.answerLabel.BackColor = System.Drawing.SystemColors.WindowText; this.answerLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.answerLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.answerLabel.Font = new System.Drawing.Font("Arial", 11.25F); this.answerLabel.ForeColor = System.Drawing.Color.White; - this.answerLabel.Location = new System.Drawing.Point(27, 316); + this.answerLabel.Location = new System.Drawing.Point(28, 318); this.answerLabel.Name = "answerLabel"; this.answerLabel.Size = new System.Drawing.Size(288, 28); this.answerLabel.TabIndex = 8; this.answerLabel.Text = "See answer here"; this.answerLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.answerLabel.Visible = false; + this.answerLabel.Click += new System.EventHandler(this.answerLabel_Click); // // genButton // this.genButton.Cursor = System.Windows.Forms.Cursors.Hand; this.genButton.FlatAppearance.BorderColor = System.Drawing.SystemColors.ControlDark; this.genButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.genButton.Font = new System.Drawing.Font("Arial", 11.25F); this.genButton.Location = new System.Drawing.Point(28, 167); this.genButton.Name = "genButton"; this.genButton.Size = new System.Drawing.Size(287, 28); @@ -153,16 +168,18 @@ private void InitializeComponent() { // label3 // this.label3.AutoSize = true; - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(38, 253); + this.label3.Font = new System.Drawing.Font("Arial", 11.25F); + this.label3.Location = new System.Drawing.Point(39, 253); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(141, 18); + this.label3.Size = new System.Drawing.Size(141, 17); this.label3.TabIndex = 11; this.label3.Text = "Select answer base:"; + this.label3.Click += new System.EventHandler(this.label3_Click); // // answerBase // this.answerBase.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.answerBase.Font = new System.Drawing.Font("Arial", 11.25F); this.answerBase.FormattingEnabled = true; this.answerBase.Items.AddRange(new object[] { "Binary - 2", @@ -171,39 +188,44 @@ private void InitializeComponent() { "Hexadecimal - 16"}); this.answerBase.Location = new System.Drawing.Point(186, 250); this.answerBase.Name = "answerBase"; - this.answerBase.Size = new System.Drawing.Size(129, 26); + this.answerBase.Size = new System.Drawing.Size(129, 25); this.answerBase.TabIndex = 10; + this.answerBase.SelectedIndexChanged += new System.EventHandler(this.answerBase_SelectedIndexChanged); // // timer1 // - this.timer1.Interval = 10000; + this.timer1.Interval = 3000; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // label4 // this.label4.BackColor = System.Drawing.SystemColors.ActiveCaptionText; this.label4.Cursor = System.Windows.Forms.Cursors.Default; + this.label4.Font = new System.Drawing.Font("Arial", 11.25F); this.label4.Location = new System.Drawing.Point(-12, -8); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(367, 55); this.label4.TabIndex = 12; - this.label4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.label4_MouseDown); + this.label4.Click += new System.EventHandler(this.label4_Click); + this.label4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormMove); // // label5 // this.label5.AutoSize = true; this.label5.BackColor = System.Drawing.Color.Black; - this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.Location = new System.Drawing.Point(13, 12); + this.label5.Font = new System.Drawing.Font("Arial Black", 14.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(13, 10); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(171, 18); + this.label5.Size = new System.Drawing.Size(242, 27); this.label5.TabIndex = 13; this.label5.Text = "RadixConvertPractice"; + this.label5.Click += new System.EventHandler(this.label5_Click); + this.label5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormMove); // // Form1 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.BackColor = System.Drawing.Color.Navy; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(255))))); this.ClientSize = new System.Drawing.Size(340, 380); this.Controls.Add(this.label5); this.Controls.Add(this.label3); @@ -218,7 +240,7 @@ private void InitializeComponent() { this.Controls.Add(this.baseList); this.Controls.Add(this.button1); this.Controls.Add(this.label4); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ForeColor = System.Drawing.Color.White; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -230,7 +252,7 @@ private void InitializeComponent() { this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "RadixConvertPractice"; this.Load += new System.EventHandler(this.Form1_Load); - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown); + this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FormMove); this.ResumeLayout(false); this.PerformLayout(); diff --git a/RadixConvertPractice/Form1.cs b/RadixConvertPractice/Form1.cs index c56719c..2964fa9 100644 --- a/RadixConvertPractice/Form1.cs +++ b/RadixConvertPractice/Form1.cs @@ -120,7 +120,7 @@ private void answerButton_Click(object sender, EventArgs e) { } break; case "Hexadecimal - 16": try { - answerLabel.Text = Convert.ToString(Convert.ToInt32(genTextbox.Text, fromBase), 16); + answerLabel.Text = Convert.ToString(Convert.ToInt32(genTextbox.Text, fromBase), 16).ToUpper(); } catch (Exception) { MessageBox.Show("error while converting base of generated number."); } break; @@ -131,11 +131,6 @@ private void answerButton_Click(object sender, EventArgs e) { timer1.Enabled = true; } - //if (genTextbox.Text.Contains("A")) answerLabel.Text = Convert.ToString(Convert.ToInt32(genTextbox.Text, 16), 2); - //else if (genTextbox.Text.Contains("9")) answerLabel.Text = Convert.ToString(Convert.ToInt32(genTextbox.Text, 10), 2); - //else if (genTextbox.Text.Contains("7")) answerLabel.Text = Convert.ToString(Convert.ToInt32(genTextbox.Text, 8), 2); - //else answerLabel.Text = genTextbox.Text; - public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; @@ -144,7 +139,7 @@ private void answerButton_Click(object sender, EventArgs e) { [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool ReleaseCapture(); - private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { + private void FormMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.Cursor = Cursors.SizeAll; ReleaseCapture(); @@ -153,13 +148,41 @@ private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs } } - private void label4_MouseDown(object sender, MouseEventArgs e) { - if (e.Button == MouseButtons.Left) { - this.Cursor = Cursors.SizeAll; - ReleaseCapture(); - SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); - this.Cursor = Cursors.Arrow; - } + private void answerLabel_Click(object sender, EventArgs e) { + Clipboard.SetText(answerLabel.Text); + MessageBox.Show("answer copied!"); + } + + private void label1_Click(object sender, EventArgs e) { + + } + + private void label2_Click(object sender, EventArgs e) { + + } + + private void lenTxb_TextChanged(object sender, EventArgs e) { + + } + + private void genTextbox_TextChanged(object sender, EventArgs e) { + + } + + private void label3_Click(object sender, EventArgs e) { + + } + + private void answerBase_SelectedIndexChanged(object sender, EventArgs e) { + + } + + private void label5_Click(object sender, EventArgs e) { + + } + + private void label4_Click(object sender, EventArgs e) { + } } } diff --git a/RadixConvertPractice/Program.cs b/RadixConvertPractice/Program.cs index 870a0f7..ee9e7c1 100644 --- a/RadixConvertPractice/Program.cs +++ b/RadixConvertPractice/Program.cs @@ -9,11 +9,10 @@ static class Program { private static Mutex mutex = null; [STAThread] static void Main() { - const string appName = "RadixConvertPractice"; bool createdNew; - mutex = new Mutex(true, appName, out createdNew); + mutex = new Mutex(true, Application.ProductName, out createdNew); if (!createdNew) { - MessageBox.Show("Only one instance of this app is allowed.", appName, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Only one instance of this app is allowed.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); diff --git a/RadixConvertPractice/Properties/AssemblyInfo.cs b/RadixConvertPractice/Properties/AssemblyInfo.cs index c57b350..7c1bc96 100644 --- a/RadixConvertPractice/Properties/AssemblyInfo.cs +++ b/RadixConvertPractice/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] [assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/dotNetFx40_Full_x86_x64.exe b/dotNetFx40_Full_x86_x64.exe new file mode 100644 index 0000000..c13f234 Binary files /dev/null and b/dotNetFx40_Full_x86_x64.exe differ diff --git a/radixIcon.jpg b/radixIcon.jpg new file mode 100644 index 0000000..5a2e35a Binary files /dev/null and b/radixIcon.jpg differ diff --git a/readme.md b/readme.md index b0184e6..03c5a82 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,11 @@ +![](./radixIcon.jpg) + # RadixConvertPractice -I programmed this minimal software to help me calculate numbers to convert to different bases (classic bases - such as binary, octal, decimal and hexadecimal). +I programed this minimal software to help me calculate numbers to convert to different bases (classic bases - such as binary (2), octal (8), decimal (10), and hexadecimal (16) bases). + +It is a portable program and it only needs [dotnet framework 4 runtime](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net40-offline-installer) as it's dependency. -It's a portable program and it only needs [dotnet framework 4 runtime](https://dl2.soft98.ir/soft/n/NET.Framework.4.x86-x64.rar?1713997359) as it's dependency. +> "dotnet framework 4 runtime" offline installer (for both 32 & 64 bit systems) is included in this repo [`dotNetFx40_Full_x86_x64.exe`](https://github.com/AliAlmasi/RadixConvertPractice/releases/latest/download/dotNetFx40_Full_x86_x64.exe) -Download the program executable file from releases page [(link to latest release)](https://github.com/AliAlmasi/RadixConvertPractice/releases/latest). \ No newline at end of file +[Click here to download the executable file, right away!](https://github.com/AliAlmasi/RadixConvertPractice/releases/latest/download/RadixConvertPractice.exe) \ No newline at end of file