如何在C#中的标签上方显示RectangleShape [英] How to display a RectangleShape upper a Label in C#

查看:557
本文介绍了如何在C#中的标签上方显示RectangleShape的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个label1和一个RectangleShap1e,第一个RectangleShape是可见的=单击Label1时,显示为"Falst",RectangleShape1显示在上部label1(它们的位置和大小相同).
大家请帮我!

I have a label1 and a RectangleShap1e, the first RectangleShape is visible=Falst when click on Label1, RectangleShape1 is displayed upper label1(they are the same position and size).but i can not

everybody help me please!
thanks.

推荐答案

如果矩形位于标签下方,则标签将使矩形模糊.它可能是可见的,但您看不到它!或者,如果您的矩形位于标签的顶部,那么您将能够看到它,但是当该矩形可见时,您将无法看到或单击标签-因为单击将转到矩形!

更改控件的顺序:
1)在设计器中打开您的表单.
2)突出显示要更改的控件.
3)从菜单格式...订购...",然后移至最前"或发送至后".

更好的方法可能是完全省去RectangleShape控件,而改用Label的BorderStyle属性:
要在标签周围显示矩形:
If you rectangle is under the label, then the label will obscure the rectangle. It may be visible, but you can''t see it! Alternately, if your rectangle is on top of the label, then you will be able to see, it, but you won''t be able to see or click on the label when the rectangle is visible - because the click will go to the rectangle!

To change the order of controls:
1) Open you form in the designer.
2) Highlight the control you want to change.
3) From the menu "Format...Order..." then "Bring to front" or "Send to back".

A better way to do this may be to dispense with the RectangleShape control altogether, and use the BorderStyle property of the Label instead:
To show a rectangle round the label:
myLabelWithABorder.BorderStyle = BorderStyle.FixedSingle;

隐藏矩形:

To hide the rectangle:

myLabelWithABorder.BorderStyle = BorderStyle.None;


这篇关于如何在C#中的标签上方显示RectangleShape的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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