当你有menustrip时,将控制设置为停靠填充 [英] Setting control to dock fill when you have a menustrip

查看:119
本文介绍了当你有menustrip时,将控制设置为停靠填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我对这个问题没有一个好的答案。


我在表格上放了一个menustrip,所以它是一个影响主菜单。


现在我在表单上放了一个webbrowser控件并设置了dock填充。


当然会发生什么是菜单覆盖了网页浏览器控件的顶部
我不想要的



是否有属性让控件自动掉落

所以它与菜单底部对齐??


或者我必须设置顶级属性并锚定控件等

实现这一目标,似乎不对。


rotsey

Hi,

I have not had a good answer to this question.

I put a menustrip on a form and so it is a main menu in affect.

Now I put a webbrowser control on the form and set it dock fill.

Of course what happens is the menu covers the top of the webbrowser control
which i do not want.

Is there a property to have the control automatically drop
so it is aligned with the bottom of the menu??

Or do i have to set the top property and anchor the control etc
to achieve this, seems wrong to have to.

rotsey

推荐答案

Rotsey写道:
Rotsey wrote:

我对这个问题没有一个好的答案。


我在表格上放了一个menustrip,所以这是一个主菜单有效。


现在我在表单上放了一个webbrowser控件并设置了dock填充。


当然会发生什么是菜单覆盖了webbrowser控件的顶部

我不想要。
I have not had a good answer to this question.

I put a menustrip on a form and so it is a main menu in affect.

Now I put a webbrowser control on the form and set it dock fill.

Of course what happens is the menu covers the top of the webbrowser control
which i do not want.



对于它的价值,我没有回复你以前的帖子的原因是

这个问题似乎很奇怪我。也就是说,我没有遇到任何麻烦。

码头填充控件与菜单条重叠。但是我当时没有时间来验证它。


从那时起我就有时间了,我可以确认我没有做任何你想做的事都没有麻烦。我在窗体上放了一个菜单,然后是一个

控件,将控件的Dock属性设置为Fill,它会对菜单条卷起来刷新

,而不是重叠。


我正在使用VS 2005和.NET 2.0。


也许你可以发布一个简洁但完整的例子代码

演示了一个包含停靠菜单条和停靠

控件的表单,其中控件与菜单条重叠。它应该只是工作,但是如果它不适合你,那么如果你可以发布代码

来证明这个问题,那么有人可以看一下并尝试

了解与你结束的代码有什么不同,比较我们其他人所拥有的



仅仅为你的表单发布一个InitializeComponent()方法就足够了,实际上......所以如果你不想发布其余的表格

马上关闭,只需发布​​该方法,我们就可以看一下。


Pete

For what it''s worth, the reason I didn''t answer your previous post was
that the problem seemed odd to me. That is, I haven''t had any trouble
having dock-filled controls overlapping the menu strip. But I didn''t
have time to verify it at the time.

Since then I have had time, and I can confirm that I don''t have any
trouble doing what you want to do. I drop a menu on the form, then a
control, set the control''s Dock property to Fill, and it winds up flush
against the menu strip, not overlapped.

I''m using VS 2005 and .NET 2.0.

Perhaps you could post a concise-but-complete example of code that
demonstrates a form that contains a docked menu strip and a docked
control, where the control winds up overlapped with the menu strip. It
should just work, but if it doesn''t for you then if you can post code
that demonstrates the problem then someone can look at it and try to
understand what''s different about the code you wind up with as compared
to what the rest of us have.

It may be sufficient to just post the InitializeComponent() method for
your form, actually...so if you don''t want to post the rest of the class
right off the bat, just post that method so we can look at it.

Pete


9月12日,9日:01 am,Rotsey

< malcolm_sm ... @ RemoveThis.optusnet.com.auwrote:
On Sep 12, 9:01 am, "Rotsey"
<malcolm_sm...@RemoveThis.optusnet.com.auwrote:

ok Pete here它是。
ok Pete here it is.



< snip>


据我所知,它不包含任何指定
DockStyle of Fill。


Jon

<snip>

As far as I can see that doesn''t contain any code specifying a
DockStyle of Fill.

Jon


我确实回复了你原来的电子邮件邮件;如果它不起作用,那么你

应该回复...

http://groups.google.co.uk/group/mic...ce51ecfd5f46cc


Marc
I did respond to your original e-mail; if it didn''t work, then you
should have replied...

http://groups.google.co.uk/group/mic...ce51ecfd5f46cc

Marc


这篇关于当你有menustrip时,将控制设置为停靠填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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