Added icon to project
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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 |
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user