Fixed title: now form has no caption, but keeps title in task bar.

This commit is contained in:
Lorenz Cuno Klopfenstein 2010-07-02 00:29:50 +02:00
parent 82b8ed0319
commit f5e4231cf9
2 changed files with 12 additions and 0 deletions

View file

@ -501,8 +501,10 @@
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(20, 34);
this.Name = "MainForm";
this.Text = "OnTopReplica";
this.TopMost = true;
this.menuContext.ResumeLayout(false);
this.menuWindows.ResumeLayout(false);

View file

@ -73,6 +73,16 @@ namespace OnTopReplica {
#region Event override
protected override CreateParams CreateParams {
get {
//Needed to hide caption, while keeping window title in task bar
var parms = base.CreateParams;
parms.Style &= ~0x00C00000; //WS_CAPTION
parms.Style &= 0x00040000; //WS_SIZEBOX
return parms;
}
}
protected override void OnShown(EventArgs e) {
base.OnShown(e);