Skip to content

Commit ddfea4f

Browse files
committed
Show drop hint on empty form startup
1 parent 711912d commit ddfea4f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

AssemblyInformation/FormMain.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,24 @@ public partial class FormMain : Form
2424

2525
private List<Binary> directDependencies;
2626

27+
private Label dropHintLabel;
28+
2729
public FormMain(string assemblyPath)
2830
{
2931
InitializeComponent();
3032
FormClosing += FormMainFormClosing;
33+
34+
dropHintLabel = new Label
35+
{
36+
Text = "Drop a .dll or .exe here\nor use Options \u2192 Open Assembly (Ctrl+O)",
37+
Dock = DockStyle.Fill,
38+
TextAlign = ContentAlignment.MiddleCenter,
39+
ForeColor = SystemColors.GrayText,
40+
Font = new Font(Font.FontFamily, 14f),
41+
AutoSize = false
42+
};
43+
Controls.Add(dropHintLabel);
44+
3145
if (assemblyPath != null)
3246
LoadAssembly(assemblyPath);
3347
}
@@ -49,6 +63,7 @@ private void LoadAssembly(string assemblyPath)
4963
AssemblyFormMap[assemblyPath] = this;
5064
Text = $"Assembly Information - {Path.GetFileName(assemblyPath)}";
5165
panel1.Visible = true;
66+
dropHintLabel.Visible = false;
5267

5368
// Re-run the load logic
5469
FormMainLoad(this, EventArgs.Empty);
@@ -60,6 +75,7 @@ private void FormMainLoad(object sender, EventArgs e)
6075
if (assemblyInformation == null)
6176
{
6277
panel1.Visible = false;
78+
dropHintLabel.Visible = true;
6379
Text = "Assembly Information";
6480
return;
6581
}

0 commit comments

Comments
 (0)