Quantcast
Channel: Adding Button in StatusBar !
Viewing all articles
Browse latest Browse all 23

Adding Button in StatusBar !

0
0

Hello Everyone,

 

I am trying to have a StatusBar in my application which has a button in one of the panels.

I am doing

StatusBarPanel panel = new StatusBarPanel();
panel.Container.Add((IComponent)this.buttonOK);

this.statusBar.Panels.Add(panel);

 

Which I know is wrong because I get

"Unable to cast object of type 'System.Windows.Controls.Button' to type 'System.ComponentModel.IComponent'"

as button is not IComponent.

 

What is the right way to do this?

 

P.S. I don't have a XAML file but doing everything through code.

 

Thank You in advance :)


Viewing all articles
Browse latest Browse all 23

Latest Images

Trending Articles





Latest Images