public int NewForm(int?width = null, int?height = null, string title = null, LuaFunction onClose = null) { var form = new LuaWinform(CurrentThread); _luaForms.Add(form); if (width.HasValue && height.HasValue) { form.Size = new Size(width.Value, height.Value); } form.Text = title; form.MaximizeBox = false; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.Icon = SystemIcons.Application; form.Show(); form.FormClosed += (o, e) => { if (onClose != null) { try { onClose.Call(); } catch (Exception ex) { Log(ex.ToString()); } } }; return((int)form.Handle); }
public int NewForm(int?width = null, int?height = null, string title = null, LuaFunction onClose = null) { var form = new LuaWinform(CurrentThread); form.BackColor = Color.LightSteelBlue; FontFamily sans = FontFamily.GenericSansSerif; form.Font = new Font("sans-serif", 10); Form1 f = new Form1(); f.BackColor = Color.White; f.Show(); f.ControlBox = false; f.FormBorderStyle = FormBorderStyle.None; f.Dock = DockStyle.Bottom; f.TopLevel = false; form.Controls.Add(f); _luaForms.Add(form); if (width.HasValue && height.HasValue) { form.Size = new Size(width.Value, height.Value); } form.Text = title; form.MaximizeBox = false; form.FormBorderStyle = FormBorderStyle.FixedSingle; form.Icon = SystemIcons.Application; form.Show(); form.FormClosed += (o, e) => { if (onClose != null) { try { f.Close(); onClose.Call(); } catch (Exception ex) { Log(ex.ToString()); } } }; return((int)form.Handle); }
public int NewForm(int?width = null, int?height = null, string title = null) { var form = new LuaWinform(); _luaForms.Add(form); if (width.HasValue && height.HasValue) { form.Size = new Size(width.Value, height.Value); } form.Text = title; form.MaximizeBox = false; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.Icon = SystemIcons.Application; form.Show(); return((int)form.Handle); }
public int NewForm(int? width = null, int? height = null, string title = null) { var form = new LuaWinform(); _luaForms.Add(form); if (width.HasValue && height.HasValue) { form.Size = new Size(width.Value, height.Value); } form.Text = title; form.MaximizeBox = false; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.Icon = SystemIcons.Application; form.Show(); return (int)form.Handle; }
public int NewForm(int? width = null, int? height = null, string title = null, LuaFunction onClose = null) { var form = new LuaWinform(); _luaForms.Add(form); if (width.HasValue && height.HasValue) { form.Size = new Size(width.Value, height.Value); } form.Text = title; form.MaximizeBox = false; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.Icon = SystemIcons.Application; form.Show(); form.FormClosed += (o, e) => { if (onClose != null) { try { onClose.Call(); } catch (Exception ex) { Log(ex.ToString()); } } }; return (int)form.Handle; }