Added icon to project

This commit is contained in:
2025-12-29 14:00:00 -05:00
parent 114b55582c
commit 8713ab0f59
4 changed files with 19 additions and 0 deletions
+11
View File
@@ -33,6 +33,17 @@ namespace ImageFrame
this.Size = new Size(400, 600); // Initial size of the window this.Size = new Size(400, 600); // Initial size of the window
this.Text = "Image Frame"; this.Text = "Image Frame";
// Use the executable's associated icon (set by the project) for the form and taskbar.
// After building the project the exe will have the app.ico icon and this will pick it up.
try
{
this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
}
catch
{
// ignore if icon extraction fails; form will use default icon
}
// Top panel with buttons // Top panel with buttons
var topPanel = new FlowLayoutPanel(); var topPanel = new FlowLayoutPanel();
topPanel.Dock = DockStyle.Top; topPanel.Dock = DockStyle.Top;
+8
View File
@@ -6,6 +6,14 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<!-- Set the application icon (icon file must exist in project root) -->
<ApplicationIcon>imageframe.ico</ApplicationIcon>
<!-- Optional: also set Win32 icon entry -->
<Win32Icon>imageframe.ico</Win32Icon>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<!-- Ensure the .ico is included in the project -->
<None Include="imageframe.ico" />
</ItemGroup>
</Project> </Project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB