font-size

c# set FontSize of TextBox

时光毁灭记忆、已成空白 提交于 2019-12-03 11:04:26
问题 How would I set the font size of a TextBox in c#. I can get the current size but it does not allow to set it. public static Form client; ((TextBox)client.Controls[0]).Font.size = 16; 回答1: You have to set the Font property. Size is a readonly property of Font . var textBox = (TextBox)client.Controls[0]; textBox.Font = new Font(textBox.Font.FontFamily, 16); 来源: https://stackoverflow.com/questions/13529563/c-sharp-set-fontsize-of-textbox

Converting between WPF font size and “standard” font size

谁说我不能喝 提交于 2019-12-03 10:45:52
问题 I've noticed in WPF, the default font size of 12 points is roughly equivalent to 9 points in "normal" applications (e.g. WordPad), 10 pt in WPF is roughly 7 pt standard, and when I try to match the default font size of 10 pt in WordPad in WPF, I've found 13 is the closest. First of all, why does WPF use such bizarre non-standard font sizes, and secondly, is there a reliable way to convert between the two? My reason for asking is I want to build a font size menu with "standard" font sizes of 9

How to customize font size in Ionic Framework

断了今生、忘了曾经 提交于 2019-12-03 10:40:50
I'm using ionic framework (with cordova) to develop mobile apps. What I want to do is to increase the font size (in general in my app). I've seen that in the official documentation : http://ionicframework.com/tutorials/customizing-ionic-with-sass/ . But I do not understand how to customize once sass is working. I'm working in a tabs-based App like that : http://forum.ionicframework.com/uploads/default/269/9934610f0a08b8d2.png I tried to manually add a class on the tab, but the result is not very clean... the text is cropped... Is there an official way to change the font-size ? I think you don

Why do <h5> and <h6> have smaller font sizes than <p> in most user agent default stylesheets?

放肆的年华 提交于 2019-12-03 09:39:59
The default <h5> and <h6> section headings in HTML5 have font sizes of 0.83em and 0.67em , respectively, while the default <p> font size is 1em . That means in a block of text containing <h5> , <h6> and <p> tags, these headings will be smaller than the text they head: (Default body font size above is 14px ) This seems counter-intuitive: headings are supposed to draw the eye and command the start of a section, and font size is an important visual cue. Is there a reason why the default font sizes make these headings smaller than the text under them? I've been searching through W3C mailing lists

How can i get default font size in pixels by using JavaScript or JQuery?

≯℡__Kan透↙ 提交于 2019-12-03 09:25:14
问题 As you know em is a relative font measurement where one em is equal to the height of the letter "M" in the default font size. An advantage in using it is because you will be able to resize the text. But how can i get default font size of current environment (in pixels) by using JavaScript or JQuery ? regards, 回答1: There are a couple of situations this can be useful- function getDefaultFontSize(pa){ pa= pa || document.body; var who= document.createElement('div'); who.style.cssText='display

Vertical Align in WPF TextBox

旧街凉风 提交于 2019-12-03 09:21:23
I have 2 TextBox es in my wpf app, one for user name and other for password, both have FontSize=20 , but the text appears like this: How can I fix this? Xaml: <TextBox Grid.Row="1" Grid.Column="1" Height="40" BorderThickness="1" BorderBrush="#FFD5D5D5" FontSize="36" Text="test" /> <PasswordBox Grid.Row="3" Grid.Column="1" Height="40" BorderThickness="1" BorderBrush="#FFD5D5D5" FontSize="36" Password="test" /> Adjust the Padding properties of these controls, e.g. Padding="0" : <TextBox Grid.Row="1" Grid.Column="1" Height="40" BorderThickness="1" BorderBrush="#FFD5D5D5" FontSize="36" Text="test"

Image to the left from a justified text

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’m trying to align a logo’s image and text. I cannot justify the second line to the width of the block. Here is the expected result: I tried this: @import url(http://fonts.googleapis.com/css?family=Ubuntu:300,500); h1 { line-height:30px; font-size:30px; background:#eee; color: #333333; } h2 { line-height:10px; font-size:12px; background:#eee; text-transform: uppercase; color: #434343; } img#logo { margin-right:10px; margin-top: 0px; float:left; } #logo_text{ font-family: 'Ubuntu', sans-serif; width: 230px; } #logo_text h2{ text-align:

Increase font size of whole web page on button click event using jquery

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to increase font size in whole page when user click on increase button. It will be increase on bases of current font size. Following is sample code : <div class='parent' style='font-size:15px'> <div class='c1'>div 1</div> <div class='c2'>div 2</div> <div class='c3'>div 3</div> <div class='c4'>div 4</div> <table style="font-size:17px"> <tr> <th>test 1</th> <th style='font-size:11px'><div>test 1.1</div><div style='font-size:22px'>test 1.2</div></th> <th>test 2</th> </tr> </table> </div> Here is my jquery code but it will not work

How do you set the font size on a UIBarButtonItem?

拟墨画扇 提交于 2019-12-03 08:11:04
问题 I can't find a way to set the font size of the title in a custom UIBarButtonItem. The only way I can think of getting around this is to set it as an image which I would like to avoid. Any other suggestions? 回答1: In a easy way, simply: Objective-C: NSUInteger fontSize = 20; UIFont *font = [UIFont boldSystemFontOfSize:fontSize]; NSDictionary *attributes = @{NSFontAttributeName: font}; UIBarButtonItem *item = [[UIBarButtonItem alloc] init]; [item setTitle:@"Some Text"]; [item

HTML/CSS: table font size different in mobile device

左心房为你撑大大i 提交于 2019-12-03 06:35:36
I would like to have a simple website that works both on desktop and mobile browser, and encountered a weird (rookie) problem: when I have a table whose column texts are of different length, the font sizes rendered in mobile device are dramatically different. Any idea why this is happening and what is a quick and clean fix? Thanks in advance for your help! The HTML code: <!DOCTYPE html> <html> <head> <style> body { font-family: Verdana, Geneva, Arial, sans-serif; font-size: medium; } table, td { border: 1px solid black; } </style> </head> <body> <table> <tr> <td>Short text. Short text</td> <td