帮助! -如何在控件中更改焦点样式? [英] HELP! - How to changes focus style in a control?

查看:99
本文介绍了帮助! -如何在控件中更改焦点样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我正在Visual Studio 2008中使用Windows窗体和C#.

问题:
我在按钮中有一个图像,我想用Tab键集中控制此控件.按钮聚焦后,按钮周围会出现一个灰色方框.

问题:
当按钮聚焦时,如何删除该正方形并且没有任何样式?


谢谢.

Hello,
I''m working with a windows forms and c# in visual studio 2008.

Problem:
I have an image in a button and I want to focus this control with tab key. Once the button is focused, a gray square appear around the button.

Question:
How can I delete this square and don''t have any style when the button is focused?


Thank u.

推荐答案

首先如何创建灰色方块".始终存在 OnLostFocus 方法.
How do you create the "gray square" in the first place. There is always the OnLostFocus Method.


这是Button类的默认呈现.如果要删除它,则需要为按钮提供自己的绘图功能.

您可能需要ButtonRenderer,这可能会有所帮助:
http://msdn.microsoft.com/fr -fr/library/system.windows.forms.buttonrenderer(v = vs.80).aspx [
This is the default rendering for the Button class. If you want to remove that, then you will need to provide your own drawing functions for the button.

You may need ButtonRenderer and this could help:
http://msdn.microsoft.com/fr-fr/library/system.windows.forms.buttonrenderer(v=vs.80).aspx[^]


这篇关于帮助! -如何在控件中更改焦点样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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