Reputation: 11
I'm writing a program for my hobby geocaching. The program has to translate a flag alphabet to text and the other way around.
What I already have is the following:
So far ... so good. I will also provide you with the code:
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 = "";
}
So ... what did I do with the flag images? Those are represented as buttons in the application and every button has a tag (alphabet).
An image can be seen through this link: http://i1304.photobucket.com/albums/s537/AngelEyesRH/PriveGeoForum/VlaggenAlfabet_zps14a5f975.jpg
But now I also want that when there's text written in the textbox, the content would convert to the flag images in a picturebox or something, under the 2 buttons under the textbox.
I really don't know how to manage that. Can somebody provide me with some help please?
I've found a possible solution here.
Upvotes: 1
Views: 771
Reputation: 766
I would suggest trying a dictionary with the images as keys and the corresponding letter as the value or vice versa. That way when text is supplied you can search for the image for each letter in the string
Upvotes: 2