Exemple #1
0
        void New_MouseClick(object sender, MouseEventArgs e)
        {
            ItemInfo_SelfNews news = sender as ItemInfo_SelfNews;
            DataRow           dr   = news.NewDr;
            string            note = dr["note"].ToString().Replace(" ", "").Replace((char)13, (char)0).Replace((char)10, (char)0);

            note = note.Length > 100 ? note.Substring(0, 100) : note;
            FrmMsg.Show(note, "提示");
        }
Exemple #2
0
        /// <summary>
        /// 新闻内容
        /// </summary>
        /// <param name="dr">新闻数据行</param>
        /// <param name="titleT">左标题</param>
        /// <param name="titleB">右标题</param>
        /// <param name="content">内容</param>
        internal void CreateInfo(DataRow dr, string titleT, string titleB, string content)
        {
            ItemInfo_SelfNews iteminfo = new ItemInfo_SelfNews();

            iteminfo.NewDr                = dr;
            iteminfo.ItemstrTitleT        = titleT;
            iteminfo.ItemstrTitleB        = titleB;
            iteminfo.Margin               = new Padding(0);
            iteminfo.MouseClick          += new MouseEventHandler(New_MouseClick);
            iteminfo.ItembackColor        = Color.FromArgb(252, 252, 252);
            iteminfo.ItembackColorMouseOn = Color.FromArgb(242, 242, 242);
            iteminfo.ItemFontColor2       = new SolidBrush(Color.FromArgb(105, 105, 105));
            iteminfo.ItemFont2            = new System.Drawing.Font("微软雅黑", 10f, FontStyle.Bold);

            iteminfo.ItemFontColor = new SolidBrush(Color.FromArgb(105, 105, 105));
            iteminfo.ItemFont      = new System.Drawing.Font("微软雅黑", 8f);

            iteminfo.ItemstrContent = content;

            iteminfo.Width  = this.Width - 2;
            iteminfo.Height = 50;

            this.Controls.Add(iteminfo);
        }