richtextbox.ContextMenu=你自己作的menu

解决方案 »

  1.   

    可不可以调用系统的右键菜单,就想textbox的一样。如果不行只好自己做。2005中的菜单做好不显示richTextBox1
    // 
                this.richTextBox1.AutoRelocate = true;
                this.richTextBox1.ContextMenuStrip = this.contextMenuStrip1;
                this.richTextBox1.Location = new System.Drawing.Point(26, 43);
                this.richTextBox1.Name = "richTextBox1";
                this.richTextBox1.Size = new System.Drawing.Size(408, 301);
                this.richTextBox1.TabIndex = 10;
                this.richTextBox1.Text = "";
    // 
    // contextMenuStrip1
    // 
                this.contextMenuStrip1.AllowDrop = true;
                this.contextMenuStrip1.CanOverflow = true;
                this.contextMenuStrip1.Items.AddRange(new system.Windows.Forms.ToolStripItem[] {
                this.fuToolStripMenuItem,
                this.fuToolStripMenuItem1,
                this.fuToolStripMenuItem2});
                this.contextMenuStrip1.Location = new System.Drawing.Point(23, 61);
                this.contextMenuStrip1.Name = "contextMenuStrip1";
                this.contextMenuStrip1.Size = new System.Drawing.Size(132, 70);
    // 
    // fuToolStripMenuItem
    // 
                this.fuToolStripMenuItem.Name = "fuToolStripMenuItem";
                this.fuToolStripMenuItem.SettingsKey = "Form1.fuToolStripMenuItem";
                this.fuToolStripMenuItem.Text = "fu";
                this.menuItem.Click += new System.EventHandler(this.menuItem_Click);private void fuToolStripMenuItem_Click(object sender, System.EventArgs e)
            {
                Clipboard.SetDataObject(richTextBox1.SelectedText);
    // richTextBox1.Copy ();
            }
    是调整哪个属性呀?谢谢!