Skip to content

Commit

Permalink
Version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AliAlmasi committed Apr 27, 2024
1 parent 1e3dda8 commit b72c0bb
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 49 deletions.
Binary file modified RadixConvertPractice.v11.suo
Binary file not shown.
76 changes: 49 additions & 27 deletions RadixConvertPractice/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 37 additions & 14 deletions RadixConvertPractice/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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();
Expand All @@ -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) {

}
}
}
5 changes: 2 additions & 3 deletions RadixConvertPractice/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions RadixConvertPractice/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Binary file added dotNetFx40_Full_x86_x64.exe
Binary file not shown.
Binary file added radixIcon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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).
[Click here to download the executable file, right away!](https://github.com/AliAlmasi/RadixConvertPractice/releases/latest/download/RadixConvertPractice.exe)

0 comments on commit b72c0bb

Please sign in to comment.