public ToolText(Control Parent) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.BackColor = myBackColor; this.Multiline = true; this.AutoSize = false; this.BorderStyle = BorderStyle.None; this.myBackAlpha = 0; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); System.Reflection.PropertyInfo _BorderStyleInfo = this.GetType().GetProperty("BorderStyle"); if (_BorderStyleInfo == null) { return; } try { if ((BorderStyle)_BorderStyleInfo.GetValue(this, new object[] { }) == BorderStyle.Fixed3D) { m_SamillSizeLeft = 8; } } catch {} this.Parent = Parent; this.Parent.MouseDown += new MouseEventHandler(Parent_MouseDown); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; }
public AlphaBlendTextBox() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; Multiline = true; RowCount = 1; this.TextChanged += (o, e) => { Size size = TextRenderer.MeasureText(this.Text, this.Font); if (this.Lines.Length > RowCount) { this.Height += this.Font.Height; RowCount++; } this.Width = size.Width+20; }; }
public ZoneTranslucide() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox();
private bool _IsMouseOver = false; // 是否鼠标MouseOver状态 #endregion public TextBoxEx() { InitializeComponent(); this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; }
public AlphaBlendTextBox(TextEdit ownerEdit) : base(ownerEdit) { components = new Container(); this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; }
public AlphaBlendTextBox() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; }
public PAlphaTextBox() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; }
public LxzhAlphaTextBox() { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.BackColor = backColor; base.BorderStyle = BorderStyle.None; this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); pictureBox = new uPictureBox(); this.Controls.Add(pictureBox); pictureBox.Dock = DockStyle.Fill; }
public SkinAlphaWaterTextBox() { this.Font = CCWin.Localization.Localizer.DefaultFont; InitializeComponent(); this.BackColor = myBackColor; this.SetStyle(ControlStyles.UserPaint, false); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.DoubleBuffer, true); myPictureBox = new uPictureBox(); this.Controls.Add(myPictureBox); myPictureBox.Dock = DockStyle.Fill; BorderStyle = BorderStyle.None; }
private void ResetState() { if (backgroundTemp != null) { base.BackgroundImage = backgroundTemp; } if (backcolorTemp != Color.Transparent) { base.BackColor = backcolorTemp; } base.Controls.Remove(picbox); picbox.Dispose(); picbox = null; tick = 0; drawH = 0; timer1.Stop(); }
/// <summary> /// 显示和消失动画 /// </summary> private void animate() { if (!timer1.Enabled) { if (backImg != null) { backImg.Dispose(); } backImg = null; backImg = new Bitmap(base.ClientRectangle.Width, base.ClientRectangle.Height); base.DrawToBitmap(backImg, base.ClientRectangle); if (alphaback != null) { alphaback.Dispose(); } alphaback = null; alphaback = new Bitmap(base.ClientRectangle.Width, base.ClientRectangle.Height); if (base.BackgroundImage != null) { backgroundTemp = (Bitmap)base.BackgroundImage; base.BackgroundImage = null; } if (base.BackColor != Color.Transparent) { backcolorTemp = base.BackColor; base.BackColor = Color.Transparent; } WIN32.CaptureWindow(this, ref alphaback); if (picbox != null) { picbox.Dispose(); } picbox = null; picbox = new uPictureBox(); this.Controls.Add(picbox); picbox.Dock = DockStyle.Fill; if (!shown) { picbox.Image = alphaback; } else { picbox.Image = backImg; } picbox.BringToFront(); base.Visible = true; if (!shown) { if (gbackImg != null) { gbackImg.Dispose(); } gbackImg = null; gbackImg = Graphics.FromImage(alphaback); gbackImg.SmoothingMode = SmoothingMode.HighQuality; } else { if (gbackImg != null) { gbackImg.Dispose(); } gbackImg = null; gbackImg = Graphics.FromImage(backImg); gbackImg.SmoothingMode = SmoothingMode.HighQuality; } isfirst = true; this.timer1.Start(); } }