C#转vb,感谢!想自己画个浏览器玩,结果遇到一个自定义的Tabcontrol需要如下代码,BUT看不懂啊看不懂啊~
privatevoidButton_Click(objectsender,RoutedEventArgse){Buttonbtn=senderasButton;strin...
private void Button_Click(object sender, RoutedEventArgs e)
{
Button btn = sender as Button;
string header = btn.Tag.ToString();
foreach (TabItem item in MainPanel.Items)
{
if (item.Header.ToString() == header)
{
MainPanel.Items.Remove(item);
break;
}
}
} 展开
{
Button btn = sender as Button;
string header = btn.Tag.ToString();
foreach (TabItem item in MainPanel.Items)
{
if (item.Header.ToString() == header)
{
MainPanel.Items.Remove(item);
break;
}
}
} 展开
1个回答
展开全部
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim btn As Button = sender
Dim header As String = btn.Tag.ToString
For Each item As TabItem In mainpanel.items
If item.header.tostring = header Then
mainpanel.items.remove(item)
Exit For
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询