MASTER GT
MASTER GT

Reputation: 13

Convert Control to Bunifu Checkbox

I need to convert often to Bunifu.Framework.UI.BunifuCheckbox . my current code:

foreach (Control often in d.flowLayoutPanel1.Controls.OfType<Bunifu.Framework.UI.BunifuCheckbox>())
{
  Bunifu.Framework.UI.BunifuCheckbox Checkbox4 = often;
  //how can i make this work?

}

thanks

Upvotes: 0

Views: 80

Answers (1)

Maik8
Maik8

Reputation: 36

You just need to cast them as that specific type, like this:

Bunifu.Framework.UI.BunifuCheckbox Checkbox4 = (Bunifu.Framework.UI.BunifuCheckbox) often;

OR

Bunifu.Framework.UI.BunifuCheckbox Checkbox4 = often as Bunifu.Framework.UI.BunifuCheckbox;

Upvotes: 0

Related Questions