如何添加关闭按钮的按钮侧 [英] How Do I Add Button Side Of Close Button

查看:81
本文介绍了如何添加关闭按钮的按钮侧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当表格boder样式相当大时,如何在C#表单中添加关闭按钮的按钮侧...

像microsoft office word ...(添加撤消,...)

how do i add a button side of close button in C# form when form boder style is sizable...
like microsoft office word ... ( add undo ,...)

推荐答案

Bill解释了解决此类问题的一种方法;这种方式当然可行。但是,它需要使用原始Windows API,而后者又需要使用P / Invoke并严重损害应用程序的平台兼容性。因此,我的第一个和主要建议将是:考虑放弃这个额外的非客户端功能,并通过.NET FCL提供的标准非客户端行为限制您的应用程序



还有一种替代方法。您可以创建申请表或窗口,而无需任何非客户区域。 (对不起,我不知道您使用的是哪个UI库/框架,因此您必须查看文档以了解如何执行;它取决于您的应用程序类型并且很容易做到。)然后您必须模拟客户区中的所有非客户元素。它可以包括:标题栏,系统图标(系统菜单区域),标题栏图标,调整大小控制区域和边框,实现窗口移动(以及可选择调整大小)行为。



-SA
Bill explained one way of solving such problems; this way can certainly work. However, it will require using raw Windows API, which in turn, will require the use of P/Invoke and badly compromise platform compatibility of your application. So, my first and and main advice would be: consider giving up this additional non-client feature and limiting your application by standard non-client behavior provided by .NET FCL.

There is one more, alternative approach. You can create the application form or window without any non-client areas. (Sorry, I don't know which UI library/framework you are using, so you have to look at documentation to find out how to do it; it depends on your application type and is easy to do.) And then you have to simulate all the non-client elements in the client area. It can include: title bar, system icon (system menu area), title bar icons, resize control areas and border, implement windows move (and optionally resize) behavior.

—SA


请参阅以下文章:

See these articles:
  • Adding caption buttons to the Non-client area on Vista[^]
  • StackOverflow: How to add an extra button to the Windows title bar[^]


这篇关于如何添加关闭按钮的按钮侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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