我是 c# 的新手,我正在尝试编写一个页面,在该页面中选择一个按钮,它将图像及其文本传递到另一个页面,但是,它向我显示了这个错误。(我在 Stars 中的代码有错误)对不起,我还是新手,所以我不明白这意味着什么。
System.Drawing.dll 参数中出现“System.ArgumentException”类型的未处理异常无效。
(第一个代码是要插入的图像和消息)
(第二个代码用于将图像和消息插入到第一个代码中)
这是第一个代码
public Booking(Image passingimage, string bandtitle)
{
InitializeComponent();
pictureBox1.Image = passingimage;
bunifuCustomLabel5.Text = bandtitle;
}
public static void Shbooking(string bandtitle, Image passingimage)
{
Booking bk = new SoftwarePrj_LawZhiMing.Booking (passingimage,bandtitle);
**bk.ShowDialog();**
}
第二代码
public partial class EandB : UserControl
{
Image passingimage;
public static string passingtitle;
private void BunifuThinButton21_Click_1(object sender, EventArgs e)
{
((Home)this.TopLevelControl).Hide();
passingimage = pictureBox6.Image;
passingtitle = bunifuCustomLabel2.Text;
Booking.Shbooking(passingtitle, passingimage);
}
}