Editable table layout pane in C #

I find the table layout pane in C # (.net 2.0) very primitive. I wanted to allow my users to resize columns in the table layout pane, but there are no ready-made options for this. Is there any way, at least, to find out if the cursor is directly above any borders of the cell, and if so, which cell is below it? Perhaps this information can be used, we can try to resize this code / column through the code. Help me find

  • whether the cursor is directly above any cell borders
  • which cell is below it (applicable only if the first question has an answer)

Many thanks,

Sudarshan Srinivasan

+5
source share
2 answers

If the layout is not too complicated, perhaps you can achieve what you want using the SplitContainer controls? Unfortunately, each SplitContainer will have only two "cells", but you can embed the SplitContainer in another SplitContiner panel to get more resizable cells:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚β”Œβ”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚β”‚     β”‚          β”‚β”‚
β”‚β”‚     β”‚          β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”β”‚
β”‚β”‚          β”‚     β”‚β”‚
β”‚β”‚          β”‚     β”‚β”‚
β”‚β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

OK, so ASCII art has never been one of my more powerful skills, but I think you understood that o)

+7
source

Based on @Fredrik MΓΆrk's solution :

SplitContainer (s) , , . SplitterMoved SplitContainer:

private void mySplitContainer_SplitterMoved(object sender, SplitterEventArgs e) {
  mOtherySplitContainer.SplitterDistance = e.SplitX;
}

SplitContainer , e.SplitX, e.SplitY.

0

All Articles