Possible Duplicate:
How to access the object itself in With … End With
Suppose I would like to do something like this:
With grid.Columns("Reviewed")
CType(<the with object>, DataGridViewCheckBoxColumn).ThreeState = False
...
End With
Basically, I would like to have the equivalent of the following in the above statement:
CType(grid.Columns("Reviewed"), DataGridViewCheckBoxColumn).ThreeState = False
Is there some keyword that I can use to refer to the object that I am “WITH”?
To my knowledge there is no way to do exactly that, but depending on what you are going to be doing it might just be easier to make another variable to reference that column.
Honestly I wouldn’t even use the With block at that point.