如何更改菜单条的位置 [英] How to Change location of menustrip
问题描述
对不起,我在第一个问题上说了控件名称,我将边框样式设置为无,但我想为表单添加Menustrip.我更改了表单的背景图片,还在表单顶部添加了一个图片框.这适用于我的表单,就像真实窗口一样.当用户单击我的图片框以移动表单时,我也处理图片框的Click事件.但是当我想要将菜单条添加到我的窗体中,使其进入我的picturebox.so下方,因此我想更改菜单条的位置.
对不起,我的错误和英语不好.
Sorry I said wront control name on my first question.I set the border style to none.But I want to add Menustrip for my form. I changed background ımage of form and also added a picturebox to top of my form .this is works for my form looks like real window.and I also handling Click event of picturebox when user clicks my picturebox its moving the form.but when I want to add menu strip to my form its going under of my picturebox.so I want to change location of menu strip.
Sorry for my Mistakes and bad english.
推荐答案
很抱歉浪费您的时间.问题是菜单条项目的锚点属性.我将其设置为上,左,下,右,问题已解决.
Sorry for wasting your time.the problem was anchor property of menu strip item. I set it to top,left,bottom,right and my problem is solved.
检查此链接:
http://stackoverflow.com/questions/283417/how- do-i-add-a-contextmenustrip-to-a-toolstripbutton [
Check this link:
http://stackoverflow.com/questions/283417/how-do-i-add-a-contextmenustrip-to-a-toolstripbutton[^]
此处是您要查找的内容,只需根据需要修改代码即可.
Here is what you are looking for, just modify the code as you want.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ContextMenuStrip1.Show(Me, Button3.Location, ToolStripDropDownDirection.BelowRight)
End Sub
该代码显示了单击按钮即可更改的菜单栏.
this code shows menu strip on the button click you can change it.
这篇关于如何更改菜单条的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!