【问题标题】:Converting text from textbox to images in picturebox将文本从文本框转换为图片框中的图像
【发布时间】:2014-02-23 22:34:55
【问题描述】:

我已经拥有的:

我正在为我的爱好寻宝编写一个程序。 程序必须将标志字母表翻译成文本,反之亦然。

我已经拥有的如下:

  • 点击不同的旗帜图像时,按字母顺序排列的结果会出现在文本框中。

到目前为止……非常好。我也会给你提供代码:

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 = "";
    }

那么……我对旗帜图像做了什么?这些在应用程序中表示为按钮,每个按钮都有一个标签(字母)。

可以通过此链接查看图片: http://i1304.photobucket.com/albums/s537/AngelEyesRH/PriveGeoForum/VlaggenAlfabet_zps14a5f975.jpg

现在我的问题/疑问:

但现在我也希望当文本框中有文字时,内容会转换为图片框或其他东西中的标志图像,在文本框下的 2 个按钮下。

我真的不知道如何管理它。有人可以帮帮我吗?

编辑:

我找到了一个可能的解决方案here

【问题讨论】:

    标签: c# winforms


    【解决方案1】:

    我建议尝试使用图像作为键、相应字母作为值的字典,反之亦然。这样,当提供文本时,您可以搜索字符串中每个字母的图像

    【讨论】:

    • 好的,谢谢。我将对此进行调查并尝试使其发挥作用。如果它不起作用,我会回来的。 ;-)
    猜你喜欢
    • 1970-01-01
    • 2021-09-01
    • 2010-11-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多