상속: System.Windows.Forms.UserControl
예제 #1
0
 public ChatMessage(ChatLogControl parent, User user, string xml)
 {
     this.parent = parent;
     this.user = user;
     stf = StringFormat.GenericTypographic;
     stf.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
     stf.FormatFlags |= StringFormatFlags.LineLimit;
     stf.LineAlignment = StringAlignment.Center;
     XmlDocument doc = new XmlDocument();
     doc.LoadXml("<body>" + xml + "</body>");
     XmlElement root = (XmlElement)doc.FirstChild;
     this.root = new RootPart(this,(XmlElement)root, new Font("Arial", 16));
     if (user != null)
         Nick = user.ID;
 }
예제 #2
0
        public ChatMessage(ChatLogControl parent, User user, string xml)
        {
            this.parent       = parent;
            this.user         = user;
            stf               = StringFormat.GenericTypographic;
            stf.FormatFlags  |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
            stf.FormatFlags  |= StringFormatFlags.LineLimit;
            stf.LineAlignment = StringAlignment.Center;
            XmlDocument doc = new XmlDocument();

            doc.LoadXml("<body>" + xml + "</body>");
            XmlElement root = (XmlElement)doc.FirstChild;

            this.root = new RootPart(this, (XmlElement)root, new Font("Arial", 16));
            if (user != null)
            {
                Nick = user.ID;
            }
        }
예제 #3
0
 public void TestControl()
 {
     TabPage page = new TabPage ();
     page.Text = "TestPage";
     ChatLogControl log = new ChatLogControl ();
     log.Dock = DockStyle.Fill;
     page.Controls.Add (log);
     User user = new User ("testid");
     user.Color = Color.Red;
     log.AddMessage (new ChatMessage (log,user, "zumindest <b>zeit<i>lich</i></b> gesehen"));
     log.AddMessage (new ChatMessage (log,user, "haha <b>test<i>5873</i></b> bla"));
     log.AddMessage(new ChatMessage(log, user, "unformatierter test text bla susch sieht das hier niemals"));
     AddTabPage (page);
 }