object b; object but; foreach(object b in this.Controls()) { if (TypeOf(b) == Button) { but Button = CType(b, Button); // here pass but to global variable. if ur variable is butctrl then butctrl=but } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)