views:

152

answers:

2

Im trying to write a usercontrol that has a 10 x 10 grid of textboxes, keyboard navigation between them and keyboard increment/decrement and then custom highlighting dependent on variables coming in on my coms module.

My idea was to store the textboxes in a 2D array for easier referencing. Am I going obout this the right way? Any other pointers?

A: 

It's been a long time since my last GUI application in C#, but if it was so similar to Java as I remember, I wouldn't create 100 grid boxes, but a table that reuses the same display/editor component for the different data...

I think almost the same MVC patterns are used in Windows Forms as in Swing, so it should work in a similar way.

fortran
A: 

It could work.

You should also take a look at the TableLayoutPanel, it will probably provide a lot of the layout and navigation you need. You can find a Control form a Tablelayout with GetControlFromPosition(row, col), but if you want to maintain a parallel array that won't hurt.

Henk Holterman
im using the TableLayoutPanel, working very well!
Tim