2015-06-14 60 views
2

我不知道如何在標題中指定,這是WPF visual basic。我想知道我怎麼寫代碼,以便在單擊按鈕時,TabControl的選擇將是= 1如何在不使用WPF控件的情況下寫出按鈕事件?

以下是我在我的主窗口,RightWindowCommands:

<Button Content="Information" Cursor="Hand" Click="InformationButton_OnClick" 
         ToolTip="View the information" 
         x:Name="InformationView"/> 

然而,我沒有使用WPF工具的按鈕,因爲這是一個圖形用戶界面,我必須將按鈕放在RightWindowCommands,我想知道如何使用代碼,以便InformationButton_OnClick給我tabControl.SelectedIndex = 1。請指導我編寫此代碼

+0

需要幫助!我只能在C#中找到解決方案,但不能使用VB!我很新,請指導我! – pleasega

回答

0

以下是處理圖片的onclick事件的一個很好的示例,您可以將其更改爲數字而不是圖片。

`AddHandler pic.Click, AddressOf pic_Click' 

Private Sub pic_Click(ByVal sender As Object, ByVal e As EventArgs) 
    Dim pic As PictureBox = DirectCast(sender, PictureBox) 
    ' etc... 
End Sub 

來源:add on click event to picturebox vb.net

相關問題