SIL.FieldWorks.Common.Widgets.VSTabControl.OnFontChanged C# (CSharp) Method

OnFontChanged() protected method

Raises the E:System.Windows.Forms.Control.FontChanged event.
protected OnFontChanged ( EventArgs e ) : void
e System.EventArgs An that contains the event data.
return void
		protected override void OnFontChanged(EventArgs e)
		{
			base.OnFontChanged(e);
			if (this.fCustomDraw)
			{
				/* The control is being custom drawn and managed font size is changed. We should inform system
				 * about such great event for it to adjust tabs' sizes. And certainly we have to create a new
				 * native font from managed one.*/
				if (this.fSysFont != IntPtr.Zero) NativeMethods.DeleteObject(this.fSysFont);
				this.fSysFont = this.Font.ToHfont();
				NativeMethods.SendMessage(this.Handle, NativeMethods.WM_SETFONT, this.fSysFont, (IntPtr)1);
			}
		}