如何将数组字体更改为斜体? [英] How to change array font to italics ?

查看:152
本文介绍了如何将数组字体更改为斜体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我想将数组elemnts字体更改为斜体.
谁能帮助我...
问候
haseeb

hello
i want to change the array elemnts font to italics.
can any body help me plz...
regards
haseeb

推荐答案

您不能更改数组或任何其他代码构造的字体.

您可能想要做的就是更改显示数组值的控件的字体.
例如文本框具有可以使用的字体样式-textbox.Font = new Font(this.Font, FontStyle.Italic);
You cannot change the font of an array or any other code construct.

What you probably want to do is change the font of the control that is displaying values of the array.
For e.g. the textbox has a fontstyle that can be used - textbox.Font = new Font(this.Font, FontStyle.Italic);


数组没有字体.它没有颜色,没有大小-只有诸如TextBox,Label,Button和RichTextBox之类的用户界面(UI,或GUI)元素才具有这些颜色.例如,字符串数组将只包含字符串作为其内容-字符串的长度和一组字符,而其他字符串则很少.

如果要在同一控件中显示与其他字符串不同的某些文本,则需要查看正确的UI控件(例如RichTextBox),或者编写自己的控件以及可能的类来保存数组元素.
An array does not have a font. It doesn''t have a color, it doesn''t have a size - only User Interface (UI, or GUI) elements such as TextBox, Label, Button, and RichTextBox have these. An array of strings for example will only have strings as its content - which have a length, and a set of characters, but very little else.

If you want to display some text differently to other strings within the same control, then you need to look at the correct UI control, (a RichTextBox, for example) or write your own control and possibly class to hold the array elements.


您无法更改,甚至无法设置您所描述的数组中的字体.但是,您可以创建一个具有字体(或字体值)作为其属性之一的类,然后将元素存储为该类的对象,每个对象都具有自己的font属性.然后,在显示数据时,请在显示每个元素时设置其字体.
You cannot change, or even set, a font in an array such as you describe. However you could create a class that has a font (or font values) as one of its properties, and then store your elements as objects of that class, each with its own font property. Then when displaying your data you set each element''s font as you display it.


这篇关于如何将数组字体更改为斜体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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