Q
字體後向不兼容
3
A
回答
3
它始終是更好地使用默認(系統)字體,實現本機的外觀。所以Vista使用'Sergoe UI'作爲默認字體,而XP使用'Tahoma'作爲這個(而不是'Verdana')。要獲得默認對話框字體使用SystemFonts類:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Font = SystemFonts.DialogFont;
}
0
你需要的是這樣的:
Font GetUIFont()
{
Font testFont = new Font("Segoe UI", 10f);
if (testFont.Name == "Segoe UI")
return testFont;
else
return new Font("Verdana", 10f);
}
0
開始JasonH的解決方案,其中包括關於從表格導出一部分。如果你有一個控制的問題,不會自動繼承窗體的字體,調用此代碼時,你的窗體有所有的控件:
foreach (Control ctl in this.Controls)
{
ctl.Font = GetUIFont();
}
相關問題
- 1. Office.Interop向後兼容?
- 2. 向後兼容Android
- 3. 向後兼容BackupAgent
- 4. ios5向後兼容
- 5. MSVCRT向後兼容?
- 6. 向後兼容setOnDateSetListener
- 7. .net 4向後兼容性
- 8. XSD向後兼容性
- 9. 向後兼容IDL/ODL
- 10. Laravel向後兼容的URL
- 11. HTML5動畫 - 向後兼容
- 12. Silverlight 5向後兼容性
- 13. 向後兼容性play-1.2.3
- 14. 向後兼容的onBackPressed
- 15. WP7.1向後兼容性
- 16. 使用onBackPressed()向後兼容
- 17. 在Sencha向後兼容
- 18. pandas.DataFrame.to_pickle向後兼容性
- 19. UWP MediaPlayerElement向後兼容性
- 20. 向後兼容性dll
- 21. MS Office PIA「向後兼容」
- 22. 對象/ XML向後兼容
- 23. GCC向後兼容性
- 24. 是scss向後兼容少?
- 25. Olingo4是否向後兼容?
- 26. C#的向後兼容性
- 27. Xcode向後兼容性
- 28. Netlogo過渡,向後兼容
- 29. 向後兼容開關
- 30. DirectX 11向後兼容
...但你怎麼辦自動爲應用程序中每個窗體和控件?你如何確保佈局仍然正確?等等 – 2009-06-16 08:31:10