C#Winforms picturebox vs Imagelist以不同的形式
我正在尝试通过if语句中的c#Winforms中的另一个形式提供图片。要更具体地,如果我从图像列表中选择图片,其计数数字为1,我想将该图片提供给另一个表单及其名称(通过手动写作),当我单击按钮时,所有这些都可以。这是我的代码,请耐心等待,并帮助我修复它。我没有任何错误,该程序运行得很好,但是我有此错误,图片和文本没有出现在其他表单上。祝你有美好的一天!!!
备注:cakechoose_pic,prajituri_pic是pictureboxes
private void button3_Click(object sender, EventArgs e)
{
if(cakeChoose_pic.Image==imageList1.Images[1])
{
Comanda comanda = new Comanda();
this.Hide();
comanda.Closed += (s, args) => this.Close();
comanda.Show();
comanda.prajituri_pic.Image = imageList1.Images[1];
comanda.prajitura_txtBox.Text = "Amandina";
}
}
I am trying to provide the picture from a PictureBox to another form in C# WinForms by if statement. To be more concrete, if I choose a pic from an image list and its count number is 1, I want to provide that picture to another form and its name (by manual writing), all that when I click a button. Here's my code, please be patient and help me to fix it. I don't have any errors, the program is working perfectly, but I have this bug, the pictures and the text doesn't appear on the other form. Have a great day!!!
Remarks: cakeChoose_pic, prajituri_pic are PictureBoxes
private void button3_Click(object sender, EventArgs e)
{
if(cakeChoose_pic.Image==imageList1.Images[1])
{
Comanda comanda = new Comanda();
this.Hide();
comanda.Closed += (s, args) => this.Close();
comanda.Show();
comanda.prajituri_pic.Image = imageList1.Images[1];
comanda.prajitura_txtBox.Text = "Amandina";
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论