开发者

Visual studio 2008 table?

I'm new to visual studio.I h开发者_如何学运维ave this simple thing to do,and i got a silly problem. Anyone knows if i can create a table in visual basic?In the GUI? I have 2 textboxes and a button.When i press that button,i need to have a table with m columns and n rows,where m and n are inputs from those 2 textbox.Want it like a matrix,so i can work with the values inside it.

Thank you,


You will need* to provide some kind of data structure in your code to which you can (in WPF) bind e.g. a ListView/GridView with TextBoxes in the cells.

Then on a button press you update the appropriate fields of your data structure with the values of the textboxes and refresh the ListView by some PropertyChanged measure.

*This is far simpler than filling some visual structure through code-behind.


If you look in the toolbox, there's an item called a table layout panel.

If you know about arrays you can create textboxes within the columns and rows.

If you can use a 2 dimensional array, simply have each dimension correspond to a column and a row, bearing in mind that the first column and row in the top right are classified as being row and column 0. Eg label(0,0) would have a row of 0 and a column of 0, label(1,0) would have a row of 1 and a column of 0.

If you need more help than that, I can talk you through it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜