2

I do not know how to specify in the title, this is in WPF visual basic. I want to know how do I write a code so that when a button is clicked, the tabcontrol selection will be = 1

Here is what I have in my MainWindow, RightWindowCommands:

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

However, I did not use the WPF tools' Button, as this is a GUI that I have to place the button at RightWindowCommands, I want to know how to come out with the code so that InformationButton_OnClick gives me tabControl.SelectedIndex = 1. Please guide me on writing this code out

1
  • Need help! I can only find solutions in C# but not VB! Im very new to this, please guide me! Commented Jun 14, 2015 at 16:52

1 Answer 1

0

Here is a nice example for onclick event handling a picture, you can change it to a number instead of picture.

`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

Source : add on click event to picturebox vb.net

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.