2,892 questions
Try something like this:
Private Sub Form_Load(sender As Object, e As EventArgs) Handles Me.Load
LoadCurrentChart()
End Sub
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
LoadCurrentChart()
End Sub
Sub LoadCurrentChart()
If TabControl1.SelectedTab Is TabPage1 Then
' Load the graphic to TabPage1 tab
LoadChart1()
ElseIf TabControl1.SelectedTab Is TabPage2 Then
' Load the graphic to TabPage2 tab
LoadChart2()
End If
End Sub