Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am trying to build a Chess GUI in C#.
How can I design a Notation Window like Arena pic
presenting variation, comments, and chess moves?

I already have a PGN Implementation class.

I need the Form Design, Presentation and Manipulation, i.e OnMouseClick, KeyPress, Edit, Insert, Delete etc.
Please see this image link , or this image.

Thanks in advance

What I have tried:

How can I present them in the GUI? I have not found anything in youtube.
Posted
Updated 4-Mar-23 23:12pm
v2
Comments
[no name] 3-Mar-23 19:52pm    
You design the ideal; then look for the controls (standard, user or custom) to make it happen. You don't start with thinking about controls first.
V_Nick 5-Mar-23 16:50pm    
I already have a PGN Implementation class.
My design include the following:
I imagine the container as a RichTextBox containing records.
Each record will have three (strings) parts side by side. Each one will be RTF string.
The first and third part will be comments (before and after) and will not be highlighted on KeyPress or MouseClick.
The second part containing the move will be chosen and highlighted.
Every record will have a start point.
Variations will start in new lines and start at different locations.
Please see the links above.

I need the Form Design, Presentation and Manipulation, i.e OnMouseClick, KeyPress, Edit, Insert, Delete etc.
V_Nick 10-Jun-23 8:30am    
Dear Gerry,
What I have in mind is create something like Chessbase or Arena Notation Window.
I want to be able to present in GUI the following structure:
(Main Line)
[Comment] move(SAN) [Comment] ... move(SAN) [Comment]
--> (variation 1)
[Comment] move(SAN) [Comment] ... move(SAN) [Comment]
--> (sub-variation 1)
[Comment] move(SAN) [Comment] ... move(SAN) [Comment]
.......................etc...........................
--> (variation 2)
[Comment] move(SAN) [Comment] ... move(SAN) [Comment]
.......................etc...........................
[Comment] move(SAN) [Comment] ... move(SAN) [Comment]...etc

As you can realise, my problem is presenting this output as ListView or DataGridView or RitchTextBox, as the cursor must highlight moves only (not comments) while the game is replayed.
Comments and moves can be changed with DoubleClick.
Any ideas?

Here are some examples:
* Chess | CodeProject[^]
* Reversi | CodeProject[^]
 
Share this answer
 
In addition to Graeme's solution, you can find a library for PGN file format here:
GitHub - iigorr/pgn.net: Portable Game Notation (PGN) implementation in .NET[^]
 
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