In a Table, where multiple rows and columns have been defined, CounterTable.ColumnCount,
is there a way to supply data (letters and numbers) to that location An apparent solution SetColumn(CounterTable, c1) only refers to controls - is this a case of vocabulary .text never seems to show up as an option. This extreme wordiness is one of the things that bugs me about VB, seems like interior decorating with military vocabulary.
Public Sub SetCellPosition(ByVal control As System.Windows.Forms.Control, ByVal position As System.Windows.Forms.TableLayoutPanelCellPosition)
Looking at definitions finds a Row option, but is it used which of these ways
...TableLayoutPanelCellPosition.Row = 2
...TableLayoutPanelCellPosition.Row(2) = "A"

Does VB allow assignment of data with Row Column
partha mandayam
David Streeter
In other words, although this object oriented stuff is supposed to allow data and controls to be treated alike, Microsoft has defined different objects for holding data and controls and doesn't bother to put in the definition that one is for data and the other for controls.
As I look at these answers, especially the first one, I suspect part of my problem is my copy's failure to load help pages from the internet even when connected via a dialup. Microsoft used to be good at giving related help and being able to link to related topics which doesn't happen in VB.
Miskky
Well, part of the problem is shown when I click on your documentation link and it takes over a minute to load.
But a greater part of the problem is that I never get to see that in my system. When I ask for help on TableLayoutPanel, what I get starts like this:
The information you are trying to access could not be found. Various events could have caused this error. (continue below)
You have chosen to use local Help only for Search and F1 results, and the topic could not be found in local Help.
This error can be caused when local Help has not been installed or only a subset of local Help was installed.
To correct this error
On the Tools menu, click Options.
Expand Help and then click Online.
In When loading Help content, select Try local first, then online.
In Search these providers, verify that MSDN Online or Codezone Community is selected.
Click OK and then try to access Help again.
You have chosen to use a mix of online and local Help for Search and F1 results, but online Help is not available.
This error can be caused when the information you are attempting to access can only
And I have seen this so many times I am sick of it. It comes up real fast. And I have followed all of the directions.
What I would like to insert here is an image, but that doesn't seem to be a choice. So I will do it two alternate ways. Make that one alternate as my website server ftp seems to go down after midnight, so no link.
In minature, I want to show this
K I C K 0 1 1 2
C O K E 1 1 1 2
I T E C 1 0 0 1
K O O K 2 1 1 2
Where the square at the left is a word grid and the numbers at the right represent how many times the letter has been used in making words.
This is very easy to impliment in QBASIC, you just print the letters and numbers with screen locating. I could do it in VB by formatting strings and doing controlled printing to a pair of text boxes. Apparently getting a gridded control to stuff the letters and the values into is difficult. Obviously a label is a nuisance. It this like the original Pascal which didn't believe in strings
To be honest, I was expecting to be able to take the values stored in la$(18,18) and lac%(18,18) and translate them to a control where I could store values and show them at the same time, so something like GridTable.row(8)col(4)=GridTable.row(8)col(4)+1. Now I am just looking for convenient way to do lac%(8,4)=lac%(8,4)+1 : GridTable.row(8)col(4)= lac%(8,4)
Renata Yasa Putra
Are you trying to "write" at certain positions in a TableLayoutPanel If so, I don't think you are using the right control - the meaning of life for a tablelayout panel is to position/resize/align *controls* - it is not an Excel-like grid control where you can edit values...
I would play around a bit with the DataGridView to make it look & feel like you want - add a couple of textbox columns, make sure that the column and row headers aren't showing, set the background color of the textbox columns for selected & normal items and so on...
Another option is to try adding labels to the positions in the table layout panel that you are playing with and set the text of the labels (haven't tried this myself)
Best regards,
Johan Stenberg
Mark Asztalos
I'm not sure if I understand what you are doing completely, so my answer might not be what you are looking for.
Why not change the data through the rows of the table
Dim dt as DataTable
dt.rows(0).item(0) = "A"
dt.rows(0).item("ColumnName") = 2
The item property is a default property so you could drop it and simply go with
dt.rows(0)(0) = "A"
But that looks awkward to me unless you are referring to your row directly
Dim r as DataRow
r(0) = "A"
r("ColumnName") = 2
Mareen Philip.
Object oriented programming will not allow you to treat data and controls the same. It is more a way to group data and operations on this data in a more structured way than what plain old imperative programming models allowed. (Yeah, there are a couple of other benefits of object modeling such as polymorphism and inheritence to name a few)
You still need to pick the right tools/classes to get your job done. Unfortunately, the number of tools here is quite large, so it can sometimes be hard to find the right tool.
I have looked at the documentation for the TableLayoutPanel class and tried to read it as if it was the first time that I encountered this control (it isn't easy to disregard previous knowledge/assumptions) and I can see that it could be misunderstood. Unfortunately it is extremely difficult to write documentation that is impossible to misunderstand. What would be a good explanation to you make someone else just scratch their head... (Me, knowing what I do about the control in question, wouldn't quite understand your disinction between controls and data - to me a control can be considered data. Maybe I've been a programmer for too long
)
Now, to the problem that you are trying to solve:
A string or an integer doesn't have a visual appearance by itself. If you want to show it on the screen, you have to either use a control that shows it in the way that you want it shown, or draw it yourself where you wnat it to show.
For simple read-only text, the most commonly used control is a Label. The label lets you control how you display the string by providing an are where the string will be shown, what font and font size will be used as well as color for the string. Unless the number of cells is large, I would suggest that you add labels to your table layout panel and use their text property to show the text that you want to show.
If the number of cells is large, or you want to display more fancy things than what the label will give you, you can draw this yourself. The TableLayoutPanel documentation has a sample where it paints the background blue for all cells that doesn't contain a control. You can use the same mechanism to draw whatever you want in the cell (including using the TextRenderer class to draw strings)
Best regards,
Johan Stenberg
Luis Mack
Hey, datagridview sounds possible:
1. Open VB Express.
2. Open Help Search
3. Type DataGridView in search
Get this
The index entry you selected has no target topics associated with it.
To view topics related to the index entry
4. Go up list to DataGrid, double click properties
Get This
The DataGrid control in Visual Basic 6.0 is replaced by the Windows Forms DataGridView control in Visual Basic 2005. The names of some properties, methods, events, and constants are different, and in some cases there are differences in behavior.
5. DataGridView in the above is a link, click on it
produces this link
ms-help://MS.VSExpressCC.v80/dv_commoner/html/1702ec84-76f9-4a82-9043-9ab8acb8aa5e.htm keywords="T:System.Windows.Forms.DataGridView"
which gives me this ***
The information you are trying to access could not be found. Various events could have caused this error.
You have chosen to use local Help only for Search and F1 results, and the topic could not be found in local Help.
This error can be caused when local Help has not been installed or only a subset of local Help was installed.
To correct this error
On the Tools menu, click Options.
Expand Help and then click Online.
In When loading Help content, select Try local first, then online.
In Search these providers, verify that MSDN Online or Codezone Community is selected.
Click OK and then try to access Help again.
HaidongJi
Sorry - I can't help you with the help problems (I have never run into this myself)
Have you tried using a datagridview (which is a grid control)
Best regards,
Johan Stenberg