private static NonActivatableForm CreateForm() { var newForm = new NonActivatableForm { StartPosition = FormStartPosition.Manual, FormBorderStyle = FormBorderStyle.FixedToolWindow, AutoValidate = AutoValidate.Disable, CausesValidation = false, ControlBox = false, MaximizeBox = false, MinimizeBox = false, ShowIcon = false, ShowInTaskbar = false, SizeGripStyle = SizeGripStyle.Hide, AutoScaleMode = AutoScaleMode.Font, AutoScroll = false, AutoSize = false, HelpButton = false, TopLevel = true, WindowState = FormWindowState.Normal, ClientSize = new Size(0, 0) }; return(newForm); }
public Bar(Monitor monitor, IEnumerable<IFixedWidthWidget> leftAlignedWidgets, IEnumerable<IFixedWidthWidget> rightAlignedWidgets, IEnumerable<ISpanWidget> middleAlignedWidgets, int barHeight = 20, Font font = null, Color? backgroundColor = null) { this.monitor = monitor; this.leftAlignedWidgets = leftAlignedWidgets.ToArray(); this.rightAlignedWidgets = rightAlignedWidgets.ToArray(); this.middleAlignedWidgets = middleAlignedWidgets.ToArray(); this.barHeight = barHeight; this.font = font ?? new Font("Lucida Console", 8); this.form = CreateForm(); if (backgroundColor != null) { this.form.BackColor = backgroundColor.Value; } }
public Bar(Monitor monitor, IEnumerable <IFixedWidthWidget> leftAlignedWidgets, IEnumerable <IFixedWidthWidget> rightAlignedWidgets, IEnumerable <ISpanWidget> middleAlignedWidgets, int barHeight = 20, Font font = null, Color?backgroundColor = null) { this.monitor = monitor; this.leftAlignedWidgets = leftAlignedWidgets.ToArray(); this.rightAlignedWidgets = rightAlignedWidgets.ToArray(); this.middleAlignedWidgets = middleAlignedWidgets.ToArray(); this.barHeight = barHeight; this.font = font ?? new Font("Lucida Console", 8); this.form = CreateForm(); if (backgroundColor != null) { this.form.BackColor = backgroundColor.Value; } }
private static NonActivatableForm CreateForm() { var newForm = new NonActivatableForm { StartPosition = FormStartPosition.Manual, FormBorderStyle = FormBorderStyle.FixedToolWindow, AutoValidate = AutoValidate.Disable, CausesValidation = false, ControlBox = false, MaximizeBox = false, MinimizeBox = false, ShowIcon = false, ShowInTaskbar = false, SizeGripStyle = SizeGripStyle.Hide, AutoScaleMode = AutoScaleMode.Font, AutoScroll = false, AutoSize = false, HelpButton = false, TopLevel = true, WindowState = FormWindowState.Normal, ClientSize = new Size(0, 0) }; return newForm; }