保持任务栏上面我的表? [英] Keep my form above the taskbar?

查看:138
本文介绍了保持任务栏上面我的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的总体目标是使第二个(或第三个,第四个......)鼠标光标。为此,我创建了一个无框的,最上面的,透明的窗口。我可以在这个窗口中绘制(我有这4个按钮来显示它的正确覆盖整个桌面) - 但是当我点击任务栏上的,它带来的顶部​​和覆盖我的按钮,并绘制行

我怎样才能让我的窗口的上方的任务栏?

另外,有我可以对最终版的画面?

绘制方法

在此先感谢!

下面是从我的了.Designer.cs文件中的code:

  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.CausesValidation = FALSE;
this.ClientSize =新System.Drawing.Size(332,332);
this.ControlBox = FALSE;
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = FALSE;
this.MinimizeBox = FALSE;
this.Name =屏幕;
this.ShowIcon = FALSE;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultBounds;
this.TopMost = TRUE;
this.TransparencyKey = System.Drawing.Color.White;
 

解决方案

我一直在挣扎了几个小时,与此相同的问题。我想到了一个很好的解决方案:只需更改动态每当形式最大化窗体底部填充

 如果Me.WindowState = FormWindowState.Maximized然后
    昏暗的PD作为新的填充
    pd.Left = Me.Padding.Left
    pd.Right = Me.Padding.Right
    pd.Top = Me.Padding.Top
    pd.Bottom = Me.Height  -  Screen.PrimaryScreen.WorkingArea.Height
    Me.Padding = PD
如果结束
 

此方式形式没有任务栏以上,但至少你的控制是! 注:在设计窗体,您可以将底部填充0。 如果你希望你的形式能够最小化/正常调整大小,那么你可能想以另一种形式事件底部填充重置为0。

My overall goal is to render a second (or third, fourth...) mouse cursor. To this end, I have created a frameless, topmost, transparent window. I can draw on this window (I have 4 buttons on it to show that it's properly covering the whole desktop) - but when I click on the taskbar, it is brought to the top and overlays my buttons and drawn line.

How can I keep my window above the taskbar?

Alternatively, is there a way that I can draw on the "final" version of the screen?

Thanks in advance!

Here's the code from my .Designer.cs file:

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.CausesValidation = false;
this.ClientSize = new System.Drawing.Size(332, 332);
this.ControlBox = false;
this.Controls.Add(this.button4);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Screen";
this.ShowIcon = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultBounds;
this.TopMost = true;
this.TransparencyKey = System.Drawing.Color.White;

解决方案

I've been struggling for a few hours with this same problem. I thought of a nice solution: just change the bottom padding of the form dynamically whenever the form is maximized.

If Me.WindowState = FormWindowState.Maximized then
    Dim pd As New Padding
    pd.Left = Me.Padding.Left
    pd.Right = Me.Padding.Right
    pd.Top = Me.Padding.Top
    pd.Bottom = Me.Height - Screen.PrimaryScreen.WorkingArea.Height
    Me.Padding = pd
end if

This way the form is not above the taskbar, but at least your controls are! Note: in designing your forms you can leave the bottom-padding 0. If you want your form to be able to minimize/normal resize, then you may want to reset the bottom padding to 0 in another form event.

这篇关于保持任务栏上面我的表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆