Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a textbox showing the moves of a chess game. I need to prevent that someting lik "5. Ke4-e6" breaks up at the end of the line. I can use non-breaking hyphens and non-breaking spaces, but then it will still break at the dot.

I figure there must be something in RTF that gets this done...

Thanks for your help. :) Eiko
Posted
Updated 6-Apr-10 3:09am
v2

C#
richTextBox1.WordWrap = false;
 
Share this answer
 
Why exactly are you using a RTF textbox? Isn't a DataGridView way more efficient and better looking?

You could make one with 2 columns, One for the Move number and the actual details. That way people can sort the moves ascending or descending and is counting all the moves as easy as checking the count number inside the DataGrid.

I know this is not an awnser to your question.. just a suggestion :)

C#
DataGridView dataGridView = new DataGridView();
dataGridView.Columns.Add("Id", "#");
dataGridView.Columns.Add("Details", "Details");

// When adding a move;
dataGridView.Rows.Add((dataGridView.Count + 1), "* Your string with details");
 
Share this answer
 
DataGridView is no real option here, as the text is not only presented as a table, but also as flowing text, i.e. in variants:

1. e2-e4 e7e5
(Also possible is 1. d2-d4)

The example is trivial and short, but you get the point... I don't want breaks within "1. d2-d4", or the team will kill me :-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900