/// <summary> /// Gets the font provided by the VS environment for dialog UI. /// </summary> /// <returns>Dialog font, or null if it is not available.</returns> public static Font GetDialogFont() { IUIHostLocale uiHostLocale = XHelperMethods.GetServiceNoThrow <IUIHostLocale, IUIHostLocale>(AsyncProjectPackage.Instance); ThreadHelper.ThrowIfNotOnUIThread(); if (uiHostLocale != null) { UIDLGLOGFONT[] pLOGFONT = new UIDLGLOGFONT[1]; if (uiHostLocale.GetDialogFont(pLOGFONT) == 0) { return(Font.FromLogFont(pLOGFONT[0])); } } return(null); }