Owner Drawing TMainMenu over Aero Glass Form?

…衆ロ難τιáo~ 提交于 2019-12-19 10:55:11

问题


The Problem I am working with a form where the aero glass border is extended from the top around 80 pixels. TMainMenu doesnt support custom positioning out of the box and I only assume it might be possible via owner draw. Drawn on a form in the default position even with double buffered to true the text does not show properly in any version of delphi (07, 09 here tested on 10 XE by friends).

What I really want is for the menu to be transparent with black text, and if possible in a lower and to the right custom position.

I have no issue using flat speed buttons and popup menu's to simulate the effect as it works well. I have to calculate the width of the text so that language translations set the width of the buttons appropriately. So I was just trying to see if there was an alternative.

What I know and have turned up Not a whole lot to be honest. Seen some API calls for making the brush transparent, which works for other tasks but not this it seems.

I have looked at some custom drawn items in VB Pascal and C# but still have not seen what I am looking for. If anyone can point me in the right direction I would appreciate it greatly. So far all I have managed todo is draw the menu without its 3d gradient.


回答1:


I do not believe this is possible, using TMainMenu. I believe that you could easily do this however by using a form-per-drop-down menu, making it a sheet of glass, and simulating one of the menus in a TMainMenu with each glass form



来源:https://stackoverflow.com/questions/4732039/owner-drawing-tmainmenu-over-aero-glass-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!