1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

csharp > is演算子 > if (myObj is Button) { > オブジェクトが指定した型にキャスト可能か調べる

Last updated at Posted at 2015-10-22

参照: Visual C# 2013 逆引き大全

is演算子 > オブジェクトが指定した型にキャスト可能か調べる

form1.cs
private void button1_click(object sender, EventArgs e)
{
  foreach (Control myObj in this.Controls)
  {
    if (myObj is Button)
    {
       ...
    }  
}

C++ Builderでは以下
http://qiita.com/7of9/items/e601b8fb10a2a40423e3

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?