Skip to content

Commit

Permalink
Fix text boxes not enabling for selections
Browse files Browse the repository at this point in the history
- Was broken by 1.0.1
- Added version label
  • Loading branch information
ThioJoe committed Feb 11, 2025
1 parent f95d842 commit ae716ff
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
17 changes: 15 additions & 2 deletions MainForm.Designer.cs

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

22 changes: 21 additions & 1 deletion MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Reflection;
using System.Runtime.InteropServices;

#nullable enable
Expand All @@ -10,16 +11,21 @@ public partial class MainForm : Form
[LibraryImport("user32.dll", EntryPoint = "SendMessageW")]
private static partial IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);

public static string VERSION = "Error getting version";

public MainForm()
{
InitializeComponent();

VERSION = DetermineVersion();
labelVersion.Text = "Version: " + VERSION;

#if DEBUG
buttonTest.Visible = true;
#endif

// Attach event handler to all radio buttons in the gbIcon group to enable/disable necessary controls when the radio button selection changes
foreach ( Control control in gbIcon.Controls )
foreach ( Control control in flowIconSelect.Controls )
{
if ( control is RadioButton rb )
{
Expand All @@ -36,6 +42,20 @@ private void btnShowDialog_Click(object sender, EventArgs e)
CreateAndShowDialog();
}

private string DetermineVersion()
{
string version = string.Empty;
version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "Unknown Version";

// If the last digit is zero, remove it
if ( version.EndsWith(".0") )
{
version = version.Substring(0, version.Length - 2);
}

return version;
}

private TaskDialogPage AssembleTaskDialogPage()
{
TaskDialogPage page = new TaskDialogPage()
Expand Down
4 changes: 2 additions & 2 deletions Windows-Task-Dialog-Generator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<LangVersion>13.0</LangVersion>
<ApplicationHighDpiMode>SystemAware</ApplicationHighDpiMode>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<AssemblyVersion>1.0.1.0</AssemblyVersion>
<FileVersion>1.0.1.0</FileVersion>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit ae716ff

Please sign in to comment.