Advertisement
Guest User

TextBoxMaterial

a guest
Jul 18th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7. using System.Drawing.Drawing2D;
  8. using System.Runtime.InteropServices;
  9. using System.ComponentModel;
  10.  
  11. namespace main.Classes.CustomControls {
  12.    
  13.     class TextBoxMaterial : TextBox {
  14.  
  15.         Label leftPadding = new Label() {
  16.             Width = 7,
  17.             Dock = DockStyle.Left,
  18.             BackColor = Color.White,
  19.         };
  20.         public TextBoxMaterial() {
  21.             this.BorderStyle = System.Windows.Forms.BorderStyle.None;
  22.             AutoSize = false;
  23.             this.Controls.Add(new Label() {
  24.                 Height = 2,
  25.                 Dock = DockStyle.Bottom,
  26.                 BackColor = Color.Gray,
  27.             });
  28.  
  29.             // This only docks and overlays above the text :(
  30.             this.Controls.Add(leftPadding);
  31.         }
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement