本文介绍了自定义.net winforms菜单栏以打开“向上"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我目前正在尝试实现自定义菜单栏,而不是将其菜单项绘制在菜单标题的下方,而宁愿将其直接绘制在菜单上方

例如代替

Hello all,
I am currently attempting to implement a custom menu strip, which instead of drawing it''s menu items with a tendency to be underneath the menu heading, instead prefers to draw them directly above

eg instead of

_________________
  |menuitem|
----|---------|--
    | item 1  |
    | item 1  |
    | item 1  |
    -----------



我们得到



we get

   ___________
   | item 1  |
   | item 1  |
   | item 1  |
-----------------
   |menuitem|
-----------------



我已经创建了一个自定义组件并继承了menustrip.
但是我被困在绘制"例程中,以覆盖它来更改菜单布局.

我可以找到很多信息,使菜单符合我喜欢的任何艳丽的颜色渐变,但是与重新放置菜单无关.
请帮忙!


忘了提一下,如果菜单栏停靠在窗体的底部,则它会按照我希望的方式运行,
但是,即使控件未停靠(即自由浮动),我也需要该控件以这种方式运行.



I''ve gotten as far as creating a custom component and inheriting menustrip.
But I''m stuck at what ''draw'' routine to override to change the menu layout.

I can find plenty of information to make the menu any gaudy colour gradient I like, but nothing much about repositioning the menu.
Help please!


Forgot to mention, the menu strip behaves the way I wish, if it is docked to the bottom of a form,
however, I need the control to operate in this manner even if it isn''t docked (ie free floating)

推荐答案


这篇关于自定义.net winforms菜单栏以打开“向上"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 23:02