diff options
Diffstat (limited to 'TimeHACK.Engine/WindowManager.cs')
| -rw-r--r-- | TimeHACK.Engine/WindowManager.cs | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/TimeHACK.Engine/WindowManager.cs b/TimeHACK.Engine/WindowManager.cs index 540dddd..fc9bd94 100644 --- a/TimeHACK.Engine/WindowManager.cs +++ b/TimeHACK.Engine/WindowManager.cs @@ -1,20 +1,44 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TimeHACK.Engine.Template; +using System.Windows.Forms; namespace TimeHACK.Engine { - class WindowManager + public class WindowManager { - private void startWinClassic(String title, int width, int height) + public void startWinClassic(UserControl content, String title, PictureBox icon, Boolean MaxButton, Boolean MinButton) { + // Setup Window WinClassic app = new WinClassic(); app.Title.Text = title; - app.Width = width + 8; - app.Height = height + 26; + app.Width = content.Width + 8; + app.Height = content.Height + 26; + content.Parent = app.programContent; + content.BringToFront(); + content.Dock = DockStyle.Fill; + if (icon == null) + { + icon = app.programIcon; + icon.Image = Properties.Resources.nullIcon; + } + app.programIcon.Image = icon.Image; + + // Check if Max button is enabled + if (MaxButton == false) + { + app.maximizebutton.Visible = false; + } + + // Check if Min button is enabled + if (MinButton == false) + { + app.minimizebutton.Visible = false; + } + + // Show the app + app.Show(); + + } } -} +}
\ No newline at end of file |
