Hey! I am making little map editor for my game, I got a textbox where I from the map with numbers and program writes them to bytes so my game can read them, but my problem is how can I read character by character from the textbox?

Recommended Answers

All 5 Replies

I think you can use the KeyDown event like this

private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            MessageBox.Show(e.KeyData.ToString());
        }

Yes, but I meant like if I got many characters in row like 123342532652 how I can read them seperately one by one, I don't want to read the whole thing just one by one.

Grab the string textbox.Text into a string mystring and march along it with the index (so mystring[0] is the first character, mystring[1] being the 2nd, etc.)

Thanks a lot, jonsca! Accessing characters C-style is way cooler than complicated parser decisions.

Miroslav

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.