C# 在picturebox中将文本从文本框转换为图像 我已经拥有的:
我正在为我的爱好写一个程序。 程序必须将旗帜字母表翻译为文本,反之亦然 我已经有了以下内容:C# 在picturebox中将文本从文本框转换为图像 我已经拥有的:,c#,winforms,C#,Winforms,我正在为我的爱好写一个程序。 程序必须将旗帜字母表翻译为文本,反之亦然 我已经有了以下内容: 单击不同的标志图像时,按字母顺序排列的结果会出现在文本框中 到目前为止。。。这么好。我还将向您提供以下代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using Sys
- 单击不同的标志图像时,按字母顺序排列的结果会出现在文本框中
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 Vlaggenalfabet
{
public partial class SeinvlaggenForm : Form
{
public SeinvlaggenForm()
{
InitializeComponent();
txtResultaat.Text = "";
}
private void ButtonAction(object sender, EventArgs e)
{
Button knop = (Button)sender;
txtResultaat.Text += " " + knop.Tag + " ";
}
private void btnWis_Click(object sender, EventArgs e)
{
txtResultaat.Text = "";
}
所以。。。我对国旗图像做了什么?这些按钮在应用程序中表示为按钮,每个按钮都有一个标签(字母表)
可以通过此链接查看图像:
现在我的问题是:
但现在我还想知道,当文本框中有文本时,内容会转换为picturebox或其他东西中的标志图像,在文本框下的2个按钮下
我真的不知道该怎么办。有人能帮我一下吗
编辑:
我已经找到了一个可能的解决方案。我建议尝试使用字典,将图像作为键,相应的字母作为值,反之亦然。这样,当提供文本时,您可以搜索字符串中每个字母的图像好的,谢谢。我将对此进行调查,并努力使其发挥作用。如果不行,我会回来的