wpf - Change tab on button click event -


i change different tab when click button. xaml follow:

<tabcontrol name="tabcontrol1" margin=" 5" selectedindex="0">             <tabitem header="properties" opacity="1">                 <grid width="1185" height="945" background="snow" > </grid> </tabitem> <tabitem header="others"> <grid> </grid> </tabitem> </tabcontrol> 

and button click event:

    private void buildbutton_click(object sender, routedeventargs e) {     tabcontrol1.selectedindex = "1"; } 

is there wrong? "cannot implicitly convert type 'string' 'int'" appears

remove quotes: tabcontrol1.selectedindex = 1;


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -