我想要另一个表单来显示从一个表单的列表框中选择的项目到另一个表单的富文本框,该表单在按钮单击时打开。我在表格 1 中使用了以下代码片段在消息框中显示内容,但现在我想要另一种表格。需要帮忙...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace cities
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StringBuilder message = new StringBuilder();
foreach (object selectedItem in listBox1.SelectedItems)
{
message.Append(selectedItem.ToString() + Environment.NewLine);
}
MessageBox.Show("You selected: \n" +message.ToString());
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}