Question: I want to check multiple controls state in one method, in C# this would be accomplished like so:

```
if (((CheckBox)sender).Checked == true)
{
    // Do something...
}
else
{
    // Do something else...
}

```

So how can I accomplish this in VB?

Answer: 
C#:

```
(CheckBox)sender

```

VB:

```
CType(sender, CheckBox)

```
[Adam Robinson](https://stackoverflow.com/questions/748725/casting-in-visual-basic/748732#748732) is correct, also [`DirectCast`](http://msdn.microsoft.com/en-us/library/7k6y2h6x(VS.71).aspx) is available to you.