zoukankan      html  css  js  c++  java
  • winform 动态添加选项卡

    ///   <summary> 
    ///   添加信息显示选项卡 
    ///   </summary> 
    public   TabPage   AddPage() 

    TabPage   tabPage   
    =   new   TabPage(); 
    RichTextBox   richTextBox   
    =   new   RichTextBox(); 

    this.tabControl1.Controls.Add(tabPage); 
    int   count   =   this.tabControl1.Controls.Count; 
    tabPage.Controls.Add(richTextBox); 
    tabPage.Location   
    =   new   System.Drawing.Point(4,   4); 
    tabPage.Name   
    =   "tabPage "   +   count.ToString(); 
    tabPage.Size   
    =   new   System.Drawing.Size(480,   271); 
    tabPage.TabIndex   
    =   this.tabControl1.Controls.Count; 
    tabPage.Text   
    =   "tabPage "   +   count.ToString(); 


    richTextBox.Anchor   
    =   ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top   |   System.Windows.Forms.AnchorStyles.Bottom)   
    |   System.Windows.Forms.AnchorStyles.Left)   
    |   System.Windows.Forms.AnchorStyles.Right))); 
    richTextBox.Location   
    =   new   System.Drawing.Point(0,   0); 
    richTextBox.Name   
    =   "richTextBox "   +   count.ToString(); 
    richTextBox.Size   
    =   new   System.Drawing.Size(480,   264); 
    richTextBox.TextChanged   
    +=   new   System.EventHandler(this.richTextBoxInfo_TextChanged); 
    richTextBox.TabIndex   
    =   0
    richTextBox.Text   
    =   " "
    return   tabPage; 
    }
    void richTextBox_TextChanged(object sender, EventArgs e)
    {
        RichTextBox richTextBox 
    = (RichTextBox) sender;
        MessageBox.Show(richTextBox.Name);
    }
  • 相关阅读:
    2020年北航OO助教工作总结
    OO第四单元——UML及其解析器——总结 暨 OO课程大总结
    OO第三单元——规格化设计与地铁系统——总结
    OO第二单元——电梯调度——总结
    OO第一单元——表达式求导——总结
    try_svg
    字体自适应
    网站使用微软雅黑需要版权吗
    body,td,th {
    input一定要在from里吗
  • 原文地址:https://www.cnblogs.com/pato/p/2009772.html
Copyright © 2011-2022 走看看