public Win32SnapshotButton(string cnb) { this.WindowClassName = cnb; this.hInstance = NativeMethods.GetModuleHandle(null); this.IsHovered = false; var brush = Application.Current.Resources["SnapshotBtnBGBrush"] as SolidColorBrush; this.BackgroundBrush = System.Drawing.Color.FromArgb(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); brush = Application.Current.Resources["SnapshotBtnHoverBrush"] as SolidColorBrush; this.HoveredBackgroundBrush = System.Drawing.Color.FromArgb(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); brush = Application.Current.Resources["SnapshotBtnFGBrush"] as SolidColorBrush; this.FontBrush = System.Drawing.Color.FromArgb(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); this.Fonts = LoadFontResource(); this.IconFontFamily = (System.Drawing.FontFamily)Fonts.Families.GetValue(0); beakerIconCollection = new Dictionary <double, Bitmap>(); hoveredBeakerIconCollection = new Dictionary <double, Bitmap>(); RegisterWindowClass(); this.hWnd = CreateWindow(this.HiLighterRect); this.IsVisible = true; Holder.Add(this.hWnd, this); }
public LineBorder(string cnb, int id) { this.WindowClassName = Invariant($"{cnb}-{id}"); this.hInstance = NativeMethods.GetModuleHandle(null); this.Id = id; var r = RegisterWindowClass(); this.hWnd = CreateWindow(); Holder.Add(this.hWnd, this); }
/// <summary> /// Constructor /// </summary> /// <param name="cn"></param> public TextTip(string cn) { this.hFont = NativeMethods.CreateFont(Default_Font_Height, 0, 0, 0, FontWeight.FW_LIGHT, false, false, false, FontCharSet.DEFAULT_CHARSET, FontPrecision.OUT_OUTLINE_PRECIS, FontClipPrecision.CLIP_DEFAULT_PRECIS, FontQuality.CLEARTYPE_QUALITY, FontPitchAndFamily.DEFAULT_PITCH, "Calibri"); this.WindowClassName = cn; this.hInstance = NativeMethods.GetModuleHandle(null); var r = RegisterWindowClass(); this.hWnd = CreateWindow(); Holder.Add(this.hWnd, this); }